Program to find the largest number of the three | SpiderShell
![]() |
| Program to find the largest number of the three | SpiderShell |
Program :
#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter three numbers : ");
scanf("%d %d %d",&a,&b,&c);
if(a>b && a>c)
{
printf("%d is largest",a);
}
if(b>a && b > c)
{
printf("%d is largest",b);
}
if(c>a && c>b)
{
printf("%d is largest",c);
}
if(a == b && a == c)
{
printf("All are equal");
}
}
Output :
Enter three numbers : 21 4 78
78 is largest.

0 Comments:
Post a Comment