Question: Add to this program by creating a void function called squareValue and have it call getValue so that it will take the value returned from

Add to this program by creating a void function called squareValue and have it call getValue so that it will take the value returned from getValue and output it's square. Thank You

#include

using namespace std;

int getValue();

int main()

{

int num;

num = getValue();

cout << "The value entered is " << num << endl;

return 0;

}

int getValue()

{

int val;

cout << "Enter a number" << endl;

cin >> val;

return val;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!