Question: int fun1(int a, int b) { a = a * 2; return a+b; } int fun2(int &a, int &b) { a = a - 2;

int fun1(int a, int b) {

a = a * 2; return a+b;

}

int fun2(int &a, int &b) {

a = a - 2; b = b * 3; return b - a;

}

int main() {

int x = 3, y = 12; int z = fun1(x, y); cout << fun2(z,y) << " ";

cout << x << " " << y << " " << z;

return 0;

}

What are the values of x, y, and z after the execution of fun1?

What are the values of x, y, and z after the execution of fun2?

What is the final output of this program?

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!