//Write a Program to Find Greatest Number Using Ladder of if-else in C.
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,num3;
clrscr();
printf("Enter the
value of First Number\n");
scanf("%d",&num1);
printf("Enter the
value of Second Number\n");
scanf("%d",&num2);
printf("Enter the
value of Third Number\n");
scanf("%d",&num3);
if(num1>num2 &&
num2>num3)
{
printf("The First
Number is Greatest and The Number is =%d",num1);
}
else if(num2>num1
&& num2>num3)
{
printf("The Second
Number is Greatest and The Number is =%d",num2);
}
else
{
printf("The Third
Number is Greatest and The Number is =%d",num3);
}
getch();
}
|
Write a Program to Find Greatest Number of Three using Ladder of if-else in C
Wednesday, February 19, 2020
0
Tags
Share to other apps