C++ Programming - References

Exercise : References - Programs
1.
Which of the following statement is correct about the program given below?
#include<iostream.h> 
int main()
{
    int x = 80; 
    int y& = x;
    x++;
    cout << x << " " << --y;
    return 0;
}
The program will print the output 80 80.
The program will print the output 81 80.
The program will print the output 81 81.
It will result in a compile time error.
Answer: Option
Explanation:
No answer description is available. Let's discuss.

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

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 12 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.

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 25 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.

5.
Which of the following statement is correct about the program given below?
#include<iostream.h> 
enum bix
{
    a=1, b, c
};
int main()
{
    int x = c;
    int &y = x;
    int &z = x;
    y = b;
    cout<< z--;
    return 0; 
}
It will result in a compile time error.
The program will print the output 1.
The program will print the output 2.
The program will print the output 3.
Answer: Option
Explanation:
No answer description is available. Let's discuss.