#include<stdio.h>
#include<conio.h>
void main ()
{
int a[100] , n, i, item, loc=-1;
clrscr ();
printf("Enter the number of elements : ");
scanf("%d",&n);
printf("Enter the numbers : \n");
for (i=0; i<=n-1; i++)
{
scanf("%d",&a[i]);
}
printf("Enter the no. to be searched : ");
scanf("%d",&item);
for (i=0; i<=n-1; i++)
{
if (item == a[i] )
{
loc = i; //SUCCESSFUL search
break;
} }
if (loc>=0)
printf("\n %d is found in position %d",item,loc+1);
else
printf("\nItem does not exist");
getch ();
}