Question: Consider the program below. Trace the code by hand and specify what the output would be if the user enters 1 2 and 1 4

Consider the program below. Trace the code by hand and specify what the output would be if the user enters 12 and 14, respectively, in fun1() when prompted.
#include
using namespace std;
void fun1(int&, int&);
void fun2(int&, int&, int&);
void fun3(int, int, int);
int main()
{
int x =0, y =0, z =0;
cout << x <<''<< y <<''<< z << endl;
fun1(x, y);
cout << x <<''<< y <<''<< z << endl;
fun2(x, y, z);
cout << x <<''<< y <<''<< z << endl;
fun3(x, y, z);
cout << x <<''<< y <<''<< z << endl;
return 0;
}
void fun1(int& a, int& b)
{
cout << "Enter two integers? ";
cin >> a >> b;
}
void fun2(int& a, int& b, int& c)
{
b++;
c--;
a = b + c;
}
void fun3(int a, int b, int c)
{
a = b - c;
}
Group of answer choices
000
12140
1415-1
1415-1
000
12140
1415-1
165-1
000
12140
12140
12140

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 Programming Questions!