Pages

How to check number is odd or even

//How to check number is odd or even.


#include<stdio.h>
#include<conio.h>

void main() {
  int num1;
  clrscr();
  printf("Enter the integer number:");
  scanf("%d",&num1);
 
  if(num1%2==0)
  {
  printf("Number is even");
   }
  else
  {
    printf("Number is odd.");
  }
 
  getch();
}

Output:

Enter the integer number:25
Number is odd.

No comments:

Post a Comment