How to Check Even or Odd Number in C language

How to Check Even or Odd Number in C language


#include<stdio.h>

void main()
{

int num; //declaration of variables

printf("Enter Any Number");
scanf("%i", &num); // getting the first value from user
// if-else condition to check even or odd

         if(num% 2 == 0)
{
printf("You have entered even number");
}

        if(num% 2 == 1)
{
printf("You have entered odd number");
}

}

Comments

Popular posts from this blog

Pseudocode to Check, Number is Odd or Even

How to Create Marksheet in C