Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming

Cpp Programming Quiz 21 – Which of the following statement is correct about the program given below?

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

#include
class Bix
{
int x, y;
public:
Bix(int x, int y)
{
this->x = x;
this->y = y;
}
void Display()
{
cout<< x << " " << y; } }; int main() { int x = 50; int &y = x ; Bix b(y, x); return 0; }

[A].The program will print the output 50 50.
[B].The program will print the two garbage values.
[C].It will result in a compile time error.
[D].The program will print nothing. 

Answer: Option D

Cpp Programming Quiz 21 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 22 – Which of the following statement is correct about the program given below?

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

#include
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

Cpp Programming Quiz 22 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 23 – Which of the following statement is correct about the program given below?

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

#include
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

Cpp Programming Quiz 23 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 24 – Which of the following statement is correct about the program given below?

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

#include
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

Cpp Programming Quiz 24 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 25 – Which of the following statement is correct about the program given below?

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

#include
struct Bix
{
short n;
};
int main()
{
Bix b;
Bix& rb = b;
b.n = 5;
cout << b.n << " " << rb.n << " "; rb.n = 8; cout << b.n << " " << rb.n; return 0; }

[A].It will result in a compile time error.
[B].The program will print the output 5 5 5 8.
[C].The program will print the output 5 5 8 8.
[D].The program will print the output 5 5 5 5. 

Answer: Option C

Cpp Programming Quiz 25 – Which of the following statement is correct about the program given below? Read More »

Cpp Programming, References

Cpp Programming Quiz 26 – Which of the following statements is correct?

Question: Which of the following statements is correct?
  1. Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
  2. A reference is not a constant pointer.

[A].Only 1 is correct.
[B].Only 2 is correct.[C].Both 1 and 2 are correct.
[D].Both 1 and 2 are incorrect.

Answer: Option D

Cpp Programming Quiz 26 – Which of the following statements is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 27 – Which of the following statements is correct?

Question: Which of the following statements is correct?
  1. An array of references is acceptable.
  2. We can also create a reference to a reference.

[A].
Only 1 is correct.
[B].Only 2 is correct.
[C].

Both 1 and 2 are correct.
[D].

Both 1 and 2 are incorrect.

Answer: Option D

Explanation:

No answer description available for this question.

Cpp Programming Quiz 27 – Which of the following statements is correct? Read More »

Cpp Programming, References