A C Program to find maximum among three numbers using else-if.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter value of a:");
scanf("%d",&a);
printf("Enter value of b:");
scanf("%d",&b);
printf("Enter value of c:");
scanf("%d",&c);
if(a>b && a>c)
{
printf("a is maximum");
}
else if(b>a && b>c)
{
printf("b is maximum");
}
else
{
printf("c is maximum");
}
getch();
}
Comments
Post a Comment