C Program to Check Two Numbers If Even or Odd

Checking Two Numbers If Even or Odd in C language


#include<stdio.h>

void main()
{

int num1, num2; //declaration of variables

printf("Enter First Number");
scanf("%i", &num1); // getting the first value from user

printf("Enter Second Number");
scanf("%i", &num2); // getting the second value from user

if(num1% 2 == 0 && num2% 2 == 0)
{
printf("You have entered two even numbers");
}

if(num1% 2 == 1 && num2% 2 == 1)
{
printf("You have entered two odd numbers");
}

        else
{
printf("You have entered one even number and one odd number");
}
}

Comments

Popular posts from this blog

Pseudocode to Check, Number is Odd or Even

How to Create Marksheet in C