Q. What is the value of x?
Code:
#include <iostream>
using namespace std;
void f(int &x)
{
x = 3;
}
int main()
{
int x = 2;
f(x);
cout << "The value of x is " << x;
return 0;
}
β
Correct Answer: (A)
3