Sunday, 24 February 2013

To Check which number is Maximum by using nested if


#include<stdio.h>
#include<conio.h>
void main()
{
float a,b,c;
clrscr();
printf("Enter the values of a,b,c");
scanf("%f%f%f",&a,&b,&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();
}

Output
Enter the values of a,b,c
3.8
5.2
7.1
c is maximum

No comments:

Post a Comment