#include<stdio.h>
      // Returns true if n is even, else odd
      int isEven(int num)
      {
          // num & 1 is 1, then odd, else even
          return (!(num & 1));
      }
      // Driver code
      int main()
      {
          int num;
          printf("Enter the number: ");
          scanf("%d",&num);
          isEven(num)? cout << "Even" : cout << "Odd";
          return 0;
      }
      
      C language logo

      E or O

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.