This C++ code is to give you idea about how the Searching system works this is the basic code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} | |
} | |
} |