Program
#include<stdio.h>
main()
{
int a;
printf("enter a number: \n");
scanf("%d",&a);
if(a%2==0)
{
printf("a is even \n");
}
else
{
printf("a is odd \n");
}
Output
enter a number:
5
a is odd
#include<stdio.h>
main()
{
int a;
printf("enter a number: \n");
scanf("%d",&a);
if(a%2==0)
{
printf("a is even \n");
}
else
{
printf("a is odd \n");
}
Output
enter a number:
5
a is odd
No comments:
Post a Comment