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
Get step-by-step solutions from verified subject matter experts
