NicolasPileci

NumeroPares

Mar 18th, 2022
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int vec[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
  6. contador = 0;
  7.  
  8. for(int i = 0; i < 10; i++)
  9. if(vec[i] % 2 == 0)
  10. contador++;
  11.  
  12. printf("Cantidad de elementos pares: %d", contador);
  13.  
  14. return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment