Advertisement
Guest User

AHAH

a guest
May 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. int vett[30];
  2. int a, b = 0;
  3.  
  4. for(int i = 0; i < 30; i++)
  5. {
  6. printf("Inserisci un numero: \t");
  7. scanf("%d", &vett[i]);
  8. }
  9.  
  10.  
  11. printf("Inserisci il numero da cercare: \t");
  12. scanf("%d", &a);
  13.  
  14. for(int i = 0; i < 30; i++)
  15. {
  16. if(a == vett[i])
  17. {
  18. b++;
  19. }
  20. }
  21.  
  22. if(!b) printf("Il numero non esiste!");
  23. else printf("Il numero esiste!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement