Thursday, May 19, 2016

Program for grestest of three numbers

Program
 #include<stdio.h>
main()
{
int a,b,c;
printf("enter the values of a,b and c \n");
scanf("%d%d%d",&a,&b,&c);
if(a>b&&a>c)
{
printf("a is greatest \n");
}
else if(b>a&&b>c)
{
printf("b is greatest \n");
}
else
{
printf("c is greatest \n");
}
}

Output
 enter the values of a,b and c:
1 2 3
c is greatest

No comments:

Post a Comment