C program to find largest among three numbers using if else.

#include<stdio.h>
#include<conio.h>
int main(){
float a, b, c;
clrscr();
printf("Enter three numbers: ");
scanf("%f %f %f", &a, &b, &c);
if (a>b)
{
if(a>c)
printf("Largest number = %.2f",a);
else
printf("Largest number = %.2f",c);
}
else
{
if(b>c)
printf("Largest number = %.2f",b);
else
printf("Largest number = %.2f",c);
}
getch();
return 1;
}

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students