C++ Programming - References - Discussion

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

Abhishek said:   5 years ago
Yes, I agree, The answer will be 50 49.

Anant Supekar said:   5 years ago
The correct answer will be 50 49.

Sada said:   1 decade ago
How reflected?


Post your comments here:

Your comments will be displayed after verification.