In this C Program, you will learn how to find the largest number among three numbers.
Largest Number Among Three Number in C |
This program uses if - else statement to find the largest number.
#include<stdio.h>
main()
{
int a,b,c;
printf("Enter three number:\n");
scanf("%d%d%d",&a,&b,&c);
if((a>b)&&(a>c))
{
printf("The gretest number is: %d",a);
}
else if((b>a)&&(b>c))
{
printf("The gretest number is: %d",b);
}
else
{
printf("The gretest number is: %d",c);
}
getch();
}
1 Comments
very good
ReplyDelete