#include<stdio.h>
int main(){
int a[20],i,j,n,c=0,loc;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
scanf("%d",&j);
for(i=0;i<n;i++){
if(a[i]==j){
c=1;
loc=i+1;
break;
}
}
if(c==1){
printf("Element found at position %d",loc);
}
else
printf("Element not found");
return 0;
}
No comments:
Post a Comment