Even Odd

C Programming

C Programming Examples

#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!