#include <stdio.h>
      
      int ifEvenOrOdd() {
        int num;
        printf("Enter an integer: ");
        scanf("%d", &num);
        // true if num is perfectly divisible by 2
        if(num % 2 == 0)
          printf("%d is even.", num);
        else
          printf("%d is odd.", num);
        return 0;
      }
      
      C language logo

      Even or Odd

      Codiga's C Recipes

      check whether a number entered by the user is even or odd

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.