Question: Given the following program what will the output be? Please explain, not just give me the answer. I know it is 11 31 #include using

Given the following program what will the output be? Please explain, not just give me the answer. I know it is 11 31

#include using

namespace std;

void one(int x, int& y);

void two(int& s, int t);

int main()

{

int u = 1;

int v = 2;

one(u, v);

cout << u << " " << v << endl;

two(u, v);

cout << u << " " << v << endl;

return 0;

}

void one(int x, int& y)

{

int a;

a = x; x = y;

y = a;

}

void two(int& s, int t)

{ int b;

b = s - t;

s = t + b + 2;

t = 4 * b;

}

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!