Program
code
#include
<stdio.h>
#include
<conio.h>
void
main()
{
int
a,b,c;
clrscr();
printf("Please
input three numbers to find the greatest among them.\n");
scanf("%d%d%d",&a,&b,&c);
if
((a>b)&&(a>c))
printf("%d
is the greatest among the given numbers.\n",a);
else
if ((b>a)&&(b>c))
printf("%d
is the greatest among the given numbers.\n",b);
else
if ((c>a)&&(c>b))
printf("%d
is the greatest among the given numbers.\n",c);
else
printf("All
numbers are equal.\n");
getch();
}
Example
of Output
Please
input three numbers to find the greatest among them.
777
40
95
777
is the the greatest among the given numbers.
No comments:
Post a Comment
Please write here, your opinion about this C program