LogiQuest
Back to References
4

What will be the output of the program?

#include <iostream>
using namespace std;

int main() {
    int a = 1, b = 2;
    int &r = a;
    r = b;
    b = 7;
    cout << a << " " << r << endl;
    return 0;
}
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.