A
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;
}
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 - Option(A)
- Views: 20
- Filed under category C++
- Hashtags:
Discusssion
Login to discuss.