#include <iostream>
using namespace std;

int main()
    int a= 10;
    int &r = a;
    cout <<"a : "<<a<<"  r : "<<r<<endl;
    r= 25;
    cout <<"a : "<<a<<"  r : "<<r<<endl;
    int b=30;
    cout <<"b : "<<b<<"  a : "<<a<<"  r : "<<r<<endl;
  return 0;
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter