#include
#include
void main(){
int arr[100],i,element,no;
clrscr();
printf("\nEnter the no of Elements: ");
scanf("%d", &no);
for(i=0;i
scanf("%d",&arr[i]);
}
printf("\nEnter the element to be searched: ");
scanf("%d", &element);
for(i=0;i
printf("\nElement found at position %d",i+1);
getch();
exit(1);
}
}
printf("\nElement not found");
getch();
}
Output:
Enter the no of Elements: 5
Enter Element 1: 12
Enter Element 2: 23
Enter Element 3: 52
Enter Element 4: 23
Enter Element 5: 10
Enter the element to be searched: 23
Element found at position 2