Kat H.

asked • 07/06/21

C++. Write a function CalculateVal that takes one integer parameter and returns the parameter plus 2.

Write a function CalculateVal that takes one integer parameter and returns the parameter plus 2.


Ex: CalculateVal(3) returns 5.


Code:


#include <iostream>

using namespace std;


/* Your code goes here */


int main() {

int input;

int result;

cin >> input;

result = CalculateVal(input);

cout << result << endl;


return 0;

}

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.