Advertisement
WarriorWolf

Untitled

Jul 14th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   int n, par, impar, c;
  6.  
  7.   for (c = 1; c < 3; c++) {
  8.     printf("Digite um numero: ");
  9.     scanf("%d", &n);
  10.  
  11.     if (n % 2 == 0) {
  12.       par++;
  13.     }
  14.     else {
  15.       impar++;
  16.     }
  17.   }
  18.  
  19.   printf("Foram informados: \nNumeros pares: %d \nNumeros impares: %d", par, impar);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement