#include<iostream.h>
#include<conio.h>
int main()
{
int a[100], n, i, item, loc=-1;
clrscr();
cout<<"Enter the number of elements : ";
cin>>n;
cout<<endl<<"Enter the numbers : "<<endl;
for(i=0; i<=n-1; i++)
{
cin>>a[i];
}
cout<<"Enter the no. to be searched : ";
cin>>item;
for(i=0; i<=n-1; i++)
{
if (item==a[i])
{
loc = i; // SUCCESSFUL search
break;
}
}
if (loc>=0)
cout<<endl<<item<<" is found in position "<<loc+1;
else
cout<<endl<<"Item does not exist";
getch();
return 0;
}