write the C program for below question
/star WAC PROGRAM WHETHER THE NUMBER IS EVEN OR ODD
star /
Answers
Answered by
1
Sample Program:
#include<stdio.h>
int main()
{
int i;
printf("Enter a number: ");
scanf("%d",&i);
if(i%2 == 0)
{
printf("%d is even",i);
}
else
{
printf("%d is odd", i);
}
return 0;
}
Output:
Enter a number: 4
4 is even.
Hope it helps!
Similar questions