C Programming

Even Odd

Learn c programming for checking user given number is even or odd

5/24/2018
0 views
even-odd.cC
#include<stdio.h>

int main() {
	int no;
	printf("Check the given number is Odd or Even\n");
	printf("Enter a number:\n");
	scanf("%d", &no);

	/* Check the modulus of 'no' is zero or not */
	if(no % 2 == 0)
		printf("It's a Even Number!\n");
	else
		printf("It's a Odd Number!\n");
	return 0;
}


/* Output */
Check the given number is Odd or Even
Enter a number:
6

It's a Even Number!

/* ---------------------------------------- */

Check the given number is Odd or Even
Enter a number:
5

It's a Odd Number!
C languageC programmingC codingeven odd number

Loading comments...

Related Examples

Deliver breaking news, insightful commentary, and exclusive reports.

Targeting readers who rely on our platform to stay ahead of the curve.

Contact Us: benzingaheadlines@gmail.com