C PROGRAM TO FIND LARGEST OF THREE NUMBERS - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Sunday, October 30, 2011

C PROGRAM TO FIND LARGEST OF THREE NUMBERS


PROGRAM TO FIND LARGEST OF THREE NUMBERS
                                                                         
#include<stdio.h>
#include<conio.h>
void main( )
{
float a,b,c;
printf(“Enter any three numbers:”);
scanf(“%f%f%f”,&a,&b,&c);
if((a>b)&&(a>c))
{
printf(“Largest of three numbers: %f”,a);
}
else
if((b>a)&&(b>c))
{
printf(“Largest of three numbers: %f”,b);
}
else
{
printf(“Largest of three numbers: %f”,c);
}
getch( );
}

No comments:

Post a Comment