fork download
  1. #include <stdio.h>
  2. int main() {
  3. int num;
  4. printf("Enter an integer: ");
  5. scanf("%d", &num);
  6.  
  7.  
  8. if(num % 2 == 0)
  9. printf("%d is even.", num);
  10. else
  11. printf("%d is odd.", num);
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 5308KB
stdin
45
stdout
Enter an integer: 45 is odd.