Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int a = 9;
6.
int & aref = a;
7.
a++;
8.
cout
Options:
A .  9
B .  10
C .  error
D .  11
Answer: Option B

The value is declared and it is post incremented, so it's value is 10.
$ g++ ref1.cpp
$ a.out
10




Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers