fork(1) 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. /* your logic goes here */
  13. if(n %2 ==0){
  14. printf("%d is even number",n);
  15. }
  16. else {
  17. printf("%d is odd number",n);
  18. }
  19.  
  20. }
  21.  
Success #stdin #stdout 0.01s 5292KB
stdin
10
stdout
 Enter any number10 is even number