fork download
  1. /* check whether a number is even or odd */
  2. /* Saurabh */
  3. #include <stdio.h>
  4.  
  5. main()
  6. {
  7. int n;
  8.  
  9. printf("\n Enter any number");
  10. scanf("%d", &n);
  11.  
  12. if (n%2==0)
  13. {
  14. printf("Num Is even");
  15. }
  16. else{
  17. printf("Num is odd");
  18. }
  19. /* your logic goes here */
  20.  
  21.  
  22. }
  23.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
 Enter any numberNum is odd