Advertisement
CotaIgnorada

arrays

Nov 13th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3. int a[10]={5,1,3,9,2,6,7,8,11,15};
  4. int x=0;
  5. int i=0;
  6. int band=0;
  7. printf("Ingrese elemento a buscar\n");
  8. scanf("%d",&x);
  9. for(i=0; i<10; i++){
  10. if(a[i]==x){
  11. printf("se encontro numero\n");
  12. band=1;
  13. }
  14. if(band==0){
  15. printf("no se encontro numero\n");
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement