Monday 21 May 2012

PROGRAM TO FIND THE GREATEST VALUE OUT OF THREE INPUTTED NUMBERS


#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the value for a");
scanf("%d",&a);
printf("enter the value for b");
scanf("%d",&b);
printf("enter the value for c");
scanf("%d",&c);

if(a>b&&a>c)
{
printf("value of a is greater = %d",a);
}
else if (b>a&&b>c)
{
printf("value of b is greater = %d",b);
}
else
{
printf("value of c is greater =%d",c);
}
 }

Output:-
enter the value for a10
enter the value for b18
enter the value for c7
value of b is greater = 18


No comments:

Post a Comment