fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int number;
  6.  
  7. printf("Enter an integer: ");
  8. scanf("%d", &number);
  9.  
  10. // True if the number is perfectly divisible by 2
  11. if(number % 2 == 0)
  12. printf("%d is even.", number);
  13. else
  14. printf("%d is odd.", number);
  15.  
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0s 2172KB
stdin
7954
stdout
Enter an integer: 7954 is even.