Subscribe Us

header ads

To find a number is even or odd


C Program to find a given number is even or odd

#include<stdio.h>
#include<conio.h>
void main()
{
    int n;
    printf("Enter any number...");
    scanf("%d",&n);
    if(n%2==0)
      printf("\n%d is a even number"
      ,n);
    else
      printf("\n%d is a odd number"
      ,n);
    getch();
}
Output :-
Enter any number...5

5 is a odd number

Post a Comment

0 Comments