google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program to Find Greatest Number Using Nested if-else in C.

Write a Program to Find Greatest Number Using Nested if-else in C.

1


Write a Program to Find Greatest Number Using Nested if-else in C.



//Write a Program to Find Greatest Number Using Nested 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)
{
if(num1>num3)
{
printf("The First Number is Greatest and The Number is =%d",num1);
}
else
{
printf("The Third Number is Greatest and The Number is =%d",num3);
}
}
else
{
if(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();
}

Output:

Write a Program to Find Greatest Number Using Nested if-else in C.

Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top