Anouncement

Check the number if it's even or odd number using C program

 Question No. 01,

Write a C program to check whether it's an even number or an odd number.

//Check the number if it's even or odd number using C program
#include <stdio.h>
int main () {
	int num;
	printf("Enter a Number:\n");
	scanf("%d", &num);
	if (num % 2 == 0)
	{
		printf("%d is an Even Number.", num);
	} else {
		printf("%d is an Odd Number.", num);
	}
	return 0;
}
Output: Enter a Number:
           10
           10 is an Even Number.
Algorithm
  1. Start.

Article bottom Ads

Central Ads Article 1

Middle Ads Article 2

Article Bottom Ads