Â
In this we are going to see how to check whether the given number is Even or Odd with the help of C Programming language.
#include <stdio.h>
void main()
{
int num;
printf("Enter an integer: ");
scanf("%d", &num);
// True if the remainder is 0
if (num % 2 == 0)
{
printf("%d is an EVEN integer.", num);
}
else
{
printf("%d is an ODD integer.", num);
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP