// C program
#include<stdio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter any three numbers:");
scanf("%d %d %d",&a,&b,&c);
if((a>b)&&(a>c))
printf("%d",a," is a largest number");
elseif((b>a)&&(b>c))
printf("%d",b," is a largest number");
else
printf("%d",c," is a largest number");
getch();
}
Sample Input/Output:
Enter any three numbers:10
20
30
30 is a largest number
#include<stdio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter any three numbers:");
scanf("%d %d %d",&a,&b,&c);
if((a>b)&&(a>c))
printf("%d",a," is a largest number");
elseif((b>a)&&(b>c))
printf("%d",b," is a largest number");
else
printf("%d",c," is a largest number");
getch();
}
Sample Input/Output:
Enter any three numbers:10
20
30
30 is a largest number
No comments:
Post a Comment