Q. Output of following C++ program?#include<iostream>using namespace std;int main(){ int x = 10; int& ref = x; ref = 20; cout << "x = " << x << endl ; x = 30; cout << "ref = " << ref << endl; return 0;} (Solved)

1. x = 20; ref = 30

2. x = 20; ref = 20

3. x = 10; ref = 30

4. x = 30; ref = 30

  • a. x = 20; ref = 30
Subscribe Now

Get All Updates & News