| 
//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(); 
} | 
Write a Program to Find Greatest Number Using Nested if-else in C.
Wednesday, February 19, 2020
1
Tags
Share to other apps



 
 
 

Thanks sir
ReplyDelete