Question: 12. The following is a program segment and the definition of a function named sub. (3 pts) Main program: X = 12; 2 = 8;
12. The following is a program segment and the definition of a function named sub. (3 pts) Main program: X = 12; 2 = 8; sub (X, 2); print(X, Z); Function sub (Y, W): Y = Y - 10; W = W + 2; What values will be printed by the program segment if X is passed by value and Z by reference to the function Sub? Z=
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
