+91-6376366224     Send message / ask question on our official What's App Number .

Programs

Question 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;
}


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 : Option D

Question 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;
}


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 : Option A

Question 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; 
}


A). The program will print the output 11 12.
B). The program will print the output 12 11.
C). The program will print the output 12 13.
D). It will result in a compile time error.
Answer : Option B

Question 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; 
}


A). The program will print the output 25 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 : Option D

Question 5 :

Which of the following statement is correct about the program given below?

#include < iostream . h > 
enum Parinam
{
    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 : Option C