Exercise: References

Questions for: References

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; 
}
A:
It will result in a compile time error.
B:
The program will print the output 1.
C:
The program will print the output 2.
D:
The program will print the output 3.
Answer: C
No answer description is available. Let's discuss.
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; 
}
A:
The program will print the output 50 49.
B:
It will result in a compile time error.
C:
The program will print the output 50 50.
D:
The program will print the output 49 49.
Answer: A
No answer description is available. Let's discuss.
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; 
}
A:
The program will print the output 11 12.
B:
The program will print the output 11 11.
C:
The program will print the output 12 13.
D:
It will result in a compile time error.
Answer: B
No answer description is available. Let's discuss.
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;
}
A:
The program will print the output 80 80.
B:
The program will print the output 81 80.
C:
The program will print the output 81 81.
D:
It will result in a compile time error.
Answer: B
No answer description is available. Let's discuss.
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;
}
A:
The program will print the output 80 80.
B:
The program will print the output 81 80.
C:
The program will print the output 81 81.
D:
It will result in a compile time error.
Answer: D
No answer description is available. Let's discuss.
Ad Slot (Above Pagination)
Quiz