Q. What is the output of the following C++ code?
Code:#include <iostream>
using namespace std;
void Sum(int a, int b, int & c)
{
a = b + c;
b = a + c;
c = a + b;
}
int main()
{
int a = 2, b =1;
Sum(a, b, b);
cout << a << " " << b;
return 0;
}
β
Correct Answer: (C)
2 5