Question: C++: Assume given the following definition of function process: void process(int vnum, int & rnum1, int & rnum2) { vnum = vnum + 5; rnum1
C++: Assume given the following definition of function process: void process(int vnum, int & rnum1, int & rnum2) { vnum = vnum + 5; rnum1 = rnum1 + 10; rnum2 = vnum + rnum1; } And that local variables are defined in function main as follows: int num1 = 10, num2 = 15, num3 = 20; Indicate whether each of the following calls of function process is valid or invalid and: For each invalid call, provide the reason why it is invalid. Do the following for each valid call: i. show the body of the function process in the way it is executed after the function call, ii. then execute function process and show the contents of the variables num1, num2, and num3 after the function is executed. a. process( num1, num2, num3 ); b. process( num2, num3, num1 ); c. process( num1, 10, num3 );
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
