Software Engineer, Your next Programming Instructor.

"Here I share myself."

Thursday, 8 November 2018

Searching Code in C++ - By Hammad Maqbool



This C++ code is to give you idea about how the Searching system works this is the basic code.


#include<iostream.h>
#include<conio.h>
void main()
{
int location=-1,item;
int arr[9];
cout<<"Enter the Data";
for(int i=0; i<=9;i++)
{
cin>>arr[i];
}
cout<<"Enter the data You want to Find";
cin>>item;
for(int j=0;j<=9;j++)
{
if(arr[j]==item)
{
cout<<"Item Found at Location "<<j;
}
}
}
view raw Searching_cpp hosted with ❤ by GitHub