#include<stdio.h>
#include<conio.h>
void main()
{
float a, b, c;
clrscr();
printf("Enter three number with space\n");
scanf("%f %f %f", &a, &b, &c);
printf("\n The largest number is:");
if(a>b)
{
if(a>c)
{
printf("%.2f",a);
}
else
{
printf("%.2f",c);
}
}
else
{
if(c>b)
{
printf("%.2f",c);
}
else
{
printf("%.2f",b);
}
}
getch();
}
C program that print the largest of the three numbers using if-else statement.
C program to find largest number, largest number finding with c program,
No comments:
Post a Comment