{To find greatest value out of 3 value}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("enter 3 numbers");
scanf("%d%d%d",&a,&b,&c);
if(a>b && a>c)
{
printf("%d",a);
}
if (b>a && b>c)
{
printf("%d",b);
}
else
{
printf("%d",c);
}
getch();
}
Output
enter 3 number
5
9
7
Ans 9
[Process completed (code 10) - press Enter]
Comments
Post a Comment