fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n, num, i, allEven = 1;
  5.  
  6. printf("Enter n: ");
  7. scanf("%d", &n);
  8.  
  9. for(i = 1; i <= n; i++) {
  10. printf("Enter num %d: ", i);
  11. scanf("%d", &num);
  12.  
  13. if(num % 2 != 0) {
  14. allEven = 0;
  15. }
  16. }
  17.  
  18. if(allEven)
  19. printf("All Even\n");
  20. else
  21. printf("Not All Even : (\n");
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5288KB
stdin
3
2
6
5
stdout
Enter n: Enter num 1: Enter num 2: Enter num 3: Not All Even : (