✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the output of the following program?
void f(int& x, int& y) {
if (x > y) {
int t = x;
x = y;
y = t;
}
}
void f(int& x, int y, int& z) {
f(x, y);
f(y, z);
f(x, y);
}
int main() {
int x = 3, y = 1, z = 2;
f(x, y, z);
cout << x << " - " << y << " - " << z << endl;
return 0;
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!