Home Top Ad

Write a program to find the largest number among three numbers.

Share:

Problem Name:      Write a program to find the largest number among three numbers.

Source Code:

#include<stdio.h>
main()
{
int a,b,c;
printf("Enter Three Number");
scanf("%d%d%d",&a,&b,&c);
if((a>b)&&(b>c))
{
    printf("%d is Greater",a);
}
else if((a<b)&&(b<c))
{
    printf("%d is Greater",c);
}
else
{
    printf("%d is Greater",b);
}
}

Output:



No comments