C Program to Find Greater Number by Using Nested If Else

0
5
digitalample eye
Write a c program to illustrate the nested if-else
Write a program to find greater number by using nested if else.

C Code

#include <stdio.h>
#include <conio.h>
void main()
{
int number1;
int number2;

printf("Enter two integer numbers :");
scanf("%d%d", &number1, &number2);

if(number1>number2)
printf("First number is larger");

else
if(number1<number2)
printf("second number is larger than first number");
else
printf("both numbers are equal");

getch();
}

Output

Find Greater Number by Using Nested If Else

Find Greater Number by Using Nested If Else

Find Greater Number by Using Nested If Else

LEAVE A REPLY

Please enter your comment!
Please enter your name here