#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
void search(int,int,int);
int A[20],size,num,i;
cout<<"\nEnter the number of elements in the array:";
cin>>size;
cout<<"\nEnter the elements of the array:";
for(i=0;i<size;i++)
cin>>A[i];
cout<<"\nEnter the element to be searched for:";
cin>>num;
search(A,size,num);
getch();
}
void search(int Arr[],int s,int n)
{
int j,loc,flag=0;
for(j=0;j<s;j++)
if(Arr[j]==n)
{
flag=1;
loc=j;
break;
}
if(flag==0)
{
cout<<"\nElement not found";
}
else
cout<<"\nElement found at position "<<(loc+1);
}