Ad Code

Write a program to check whether the given number is even or odd by using if-else statement.

Write a program to check whether the given number is even or odd by using if-else statement.



#inlcude<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf(“Enter the number:”);
scanf(“%d”,&a);
if(a%2==0)
{
printf(“The number is even”);
}
else
{
printf(“The number is odd”);
}
getch();
}

Output:-


Post a Comment

0 Comments

Ad Code