This is an if else statement even odd c program. It inputs a number from user and checks it for even or odd number. It displays a suitable message accordingly.
/*input a number. Check whether this number is even or odd */ #include<stdio.h> int main() { int num; printf("Enter a number to check for even / odd:"); scanf("%d",&num); if(num%2 == 0) printf("%d is even",num); else printf("%d is odd",num); return 0; }
You may also like a related C program To check number for even odd using conditional ternary operator
You may also like a related program to find even odd in C++ on easycppprogramming.blogspot.com