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:
Post a Comment