πŸ“Š C++
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;
}
  • (A) 3
  • (B) 2
  • (C) Compilation error
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
196
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
98%
Success Rate