Brijmohan lal Sahu - Facebook
ads
ads
Showing posts with label greatest number. Show all posts
Showing posts with label greatest number. Show all posts

Friday, October 31, 2014

Program to find greatest number among three numbers using function




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

#include<iostream.h>
#include<conio.h>
void main()
{
float a,b,c,g;
float great(float ,float ,float );
clrscr();
cout<<"Enter three number:";
cin>>a>>b>>c;

g=great(a,b,c);

cout<<"Greater number is:"<<g;
getch();
}

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