C Program to Find the largest number among three numbers:This is to find the largest number among three numbers using c.
in which we take three number from user and find the largest number among them.
For Example:
A = 10
B = 30
C = 8
There is largest numbe ris B: 30
ALGORITHM:-
step 1 : Start
step 2 : Enter three number
step 3 : if(a-b>0 and a-c>0) that means Number A is greater
step 4 : if(b-c>0) means Number B is greater
step 5 : else Number C is greater
step 6 : Stop
PROGRAM CODE:-
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("\nEnter 3 numbers: ");
scanf("%d %d %d", &a, &b, &c);
if(a-b>0 && a-c>0)
{
printf("\nGreatest is a :%d",a);
}
else if(b-c>0)
{
printf("\nGreatest is b :%d",b);
}
else
{
printf("\nGreatest is c :%d",c);
}
getch();
}
OUTPUT:-
Enter three number:
30 10 50
Number C is greater: 50
C Program to find the largest number among three How to find the largest number among three number using c Find the largest number
ConversionConversion EmoticonEmoticon