63 083
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #4520 in C++ for David Obot Umoekah

Question #4520
Your program reads float numbers and during the reading every time the (absolute) biggest number
is printed. To do so, use a function Find_max() that from two numbers returns the biggest.
The program ends after entering the number 0.

draw PSD for the program before writing program.
Expert's answer
#include <cstdlib>
#include <iostream>

using namespace std;
float a,b,Max;
float Find_max(float a,float b)
{
if (a>=b) return Max=a;
else return Max=b;
}
int main(int argc, char *argv[])
{
cout<<"Enter first numder a = ";
cin>>a;
cout<<"Enter second numder b = ";
cin>>b;
if (a==b) cout<<"a = b = "<<a<<endl;
else if (a==0 || b==0) exit();
else
{
& Find_max(a,b);
& cout<<"Max = "<<Max<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions