Brijmohan lal Sahu - Facebook
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday, November 6, 2014

Program to find greatest number among 3 Using function in C.

Greatest Number


Code Box
--------------------------------------

/*Program to find greatest number among 3  Using function */

#include<stdio.h>
#include<conio.h>
void main()
{
float a,b,c,g;
float great(float ,float ,float );
clrscr();

printf("Enter three number:");
scanf("%f %f %f",&a,&b,&c);

printf("\na= %f b=%f c=%f",a,b,c);
g=great(a,b,c);

printf("Greater number is: %f",g);
getch();
}

float great(float a,float b,float c)
{
if(a>b && a>c)
{
return(a);
}
else
if(b>c)
{return(b);
}
else
{return(c);
}

}

No comments: