#include<iostream.h>
void Lsearch(int [ ],int,int);
void main( )
{
int arr[50];int n;int num;
cout<<"Enter the no. of elements:";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<"Enter the element "<<i+1<<":"; cin>>arr[i];
}
cout<<"Enter the element to be searched:"; cin>>num;
Lsearch(arr,n,num);
}
void Lsearch(int ar[],int size,int number)
{
int flag=0,pos;
for(int i=0;i<size;i++)
{
if(ar[i]==number)
{
pos=i+1;
flag=1;
break;
}
}
if(flag==1)
cout<<"Element Found at position:"<<pos;
else
cout<<"Element not found..";
}