#include<stdio.h> int main() { int r[20],e,s,a; printf("Enter array size"); scanf("%d",&a); printf("Enter array elements:\n"); for(e=0;e<a;++e) scanf("%d",&r[e]); printf("\nAny number enter to search:"); scanf("%d",&s); for(e=0;e<a;++e) if(r[e]==s) break; if(e<a) printf("Number found at loctation %d",e+1); else printf("Number not found"); return 0; }
Subscribe to:
Post Comments
(
Atom
)
Post a Comment