Need a project done?

C++ Programming Developer

Search This Blog

Function to calculate Largest of 3 (three) Numbers

Q. Write a function to calculate largest of 3 numbers.

using namespace std;
double largest_of_three(double,double,double);

int main()
double a,b,c;

cout<<"a = "; cin>>a;
cout<<"b = "; cin>>b;
cout<<"c = "; cin>>c;

cout<<"Largest: "<<largest_of_three(a,b,c)<<endl;

double largest_of_three(double a, double b, double c)

if (a > b && a > c)
return a;
else if (b>c && b>a)
return b;
else return c;
"Don't let anyone ever make you feel like you don't deserve what you want."