Find the greatest between four numbers using 'c'
(Click on read more to get the full code)
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
printf("Enter the numbers:");
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a>b&&a>c&&a>d)
printf("%d is greater.",a);
else if(b>c&&b>d)
printf("%d is greater.",b);
else if(c>d)
printf("%d is greater.",c);
else
printf("%d is greater.",d);
getch();
}
OUTPUT:
Enter the numbers:59
25
50
37
59 is greater.
Comments
Post a Comment