C++ Programming - References - Discussion

Discussion Forum : References - Programs (Q.No. 3)
3.
Which of the following statement is correct about the program given below?
#include<iostream.h> 
int main()
{
    int x = 10;
    int &y = x;
    x++;
    cout<< x << " " << y++;
    return 0; 
}
The program will print the output 11 12.
The program will print the output 11 11.
The program will print the output 12 13.
It will result in a compile time error.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
14 comments Page 2 of 2.

Hatos said:   8 years ago
I got this output as 11 11.

Am I right?
(2)

Amoli said:   7 years ago
It is right to left evaluation.

Swetha said:   6 years ago
The output is :11 11.
(4)

Anusha said:   5 years ago
The output is 11 11.
(4)


Post your comments here:

Your comments will be displayed after verification.