C Program to Check if Given Number is Odd or Even

//WAP TO TEST THE GIVEN NUMBER IS ODD OR EVEN

#include<stdio.h>

int main()
{
	int a;
	printf("Enter the number :--> ");
	scanf("%d",&a);

	if(a%2 == 0)
	{
		printf("%d is an even number ",a);
	}
	else
	{
		printf("%d is an odd number ",a);
	}

	return 0;
}

<< Previous | Next >>


  • C++ Program to Check if Given Number is Odd or Even
  • Java Program to Check if Given Number is Odd or Even
  • Python Program to Check if Given Number is Odd or Even