1Value of i : 5
2Value of i reference : 5
3Value of d : 11.7
4Value of d reference : 11.7
5
1#include <iostream>
2
3using namespace std;
4
5int main () {
6 // declare simple variables
7 int i;
8 double d;
9
10 // declare reference variables
11 int& r = i;
12 double& s = d;
13
14 i = 5;
15 cout << "Value of i : " << i << endl;
16 cout << "Value of i reference : " << r << endl;
17
18 d = 11.7;
19 cout << "Value of d : " << d << endl;
20 cout << "Value of d reference : " << s << endl;
21
22 return 0;
23}