C Program to check whether the number is Odd or Even

C Program to check whether the number is Odd or Even

Here using C program you can find out whether the number is odd or even.

Odd number :

Odd numbers are those numbers which cannot be divided into two equal parts. Such as 1, 3, 5, 7, 9, 11,...etc.

Even number :

Even numbers are those numbers that can be divided into two equal parts. Examples of even numbers are 2, 4, 6, 8, 10, 12, 14,…etc.


Calendar of Odd or Even numbers :

You can easily check the numbers using the program below :

//Using this program we can 
//check whether numbers are odd or even.
#include <stdio.h>
int main()
{
  int num;
  //Input number an integer
  printf("Enter a number: ");
  scanf("%d", &num);
  
  // condition 
  if (num % 2 == 0)
  {
    printf("Even number.");
  }
  else
  {
    printf("Odd number.");
  }
  return 0;
}

Output:

Enter a number: 16
Even number.

Enter a number: 15
Odd number.

*

Post a Comment (0)
Previous Post Next Post