1. Write a C++ program that asks users for two
entries of type double, x and y, and then displays their product.
Your code should have:
1) a function called get_x that asks the users for the value of x, then returns x to the main function.
2) a function called get_y that asks the users for the value of y, then returns y to the main function.
3) a function called mult_xy that takes x and y as its arguments and returns their product to the main function.
This program must use all three functions.
2. We mentioned that a function can only return
one value using the return statement. Is there any way that a function
returns more than one value? In the above program, could you read
both x and y in the same function, and then return both of them to the
3. Can a function call another function? Maybe
this helps you answer this question.
In the following program, is main a function?
Does it call another function?
using namespace std;
float divide_xy(int x, int y);
cout << "Enter
2 values for x and y separated by space, then press <Enter> :";
cin >> x >> y;
cout << endl;
qt = divide_xy(x,y);
cout << x << "/" << y << " = " << qt << endl;
float divide_xy(int x, int y)
4. Explain how you may have use for a function that does not return
5. Explain how you may have use for a function that does not have any argument?