C Programming

C Program to Find Greater Number by Using 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

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.