C Program to Find Greater Number by Using Nested If Else

Find Greater Number by Using Nested If Else, C Program to Find Greater Number by Using Nested If Else, Write a c program to illustrate the nested if-else Write a program to find greater number by using nested if else.

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

You May Also Like...

Socialize with Us