Write a c program to find the largest of three numbers or Write a c program largest among three numbers or C Program for largest of 3 numbers.
Write a c program to find the largest of three numbers or Write a c program largest among three numbers or C Program for largest of 3 numbers.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter three numbers\n");
scanf("%d%d%d",&a,&b,&c);
if(a>b)
if(a>c)
printf("%d is the greatest",a);
else
printf("%d is the greatest",c);
else if(b>c)
printf("%d is the greatest",b);
else
printf("%d is the greatest",c);
getch();
}
Output:
Enter three numbers
3
4
5
5 is the greatest
No comments: