C Program to compare two numbers and then find even or odd in C language

C program to find bigger and smaller number among two numbers.
if number is bigger then check number is even or odd 



/**************************************************

C program to find bigger and smaller number among two numbers.
if number is bigger then check number is even or odd

**********************************************************/
#include<stdio.h>
void main()
{
int a,b;
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
if(a>b)
{
printf("First number %d is bigger than %d\n",a,b);
if(a%2==0)
{
printf("The number %d is even\n",a);
}
else
{
printf("The number %d is odd\n",a);
}
}
else
{
printf("Second number %d is bigger\n ",b);
}
if(b%2==0)
{
printf("The second number %d is odd",b);
}
else
{
printf("The number %d is odd",b);
}
}


First Output

Enter two numbers

12

33

Second number 33 is bigger

The number 33 is odd


Second output

Enter two numbers

99

12

First number 99 is bigger than 12

The number 99 is odd

The second number 12 is odd

टिप्पणी पोस्ट करा

0 टिप्पण्या