Cpp Programming Quiz 219 – It is a __________ error to pass arguments to a destructor.
[A].
logical
[B].virtual
[C].
syntax
[D].
linker
Answer: Option C
Explanation:
No answer description available for this question.
syntax
[D].
linker
Answer: Option C
Explanation:
No answer description available for this question.
only pass-by-reference
[D].
only pass by address
Answer: Option C
Explanation:
No answer description available for this question.
Answer: Option C
#include
class IndiaBix
{
int x, y, z;
public:
IndiaBix(int x = 100, int y = 30, int z = 0)
{
this->x = x;
this->y = y;
this->z = z;
Display();
}
void Display()
{
cout<< x << " " << y << " " << z;
}
};
int main()
{
int a = 0, b = 1, c = 2;
int &x = ++a;
int &y = --b;
int z = c + b - -c;
IndiaBix objBix(x, y, z);
return 0;
}
[A].The program will print the output 1 0 3.
[B].The program will print the output 1 0 4.
[C].The program will print the output 1 1 3.
[D].The program will print the output 1 1 4.
Answer: Option B
Answer: Option C
#include
void Tester(int xx, int yy = 5);
class IndiaBix
{
int x;
int y;
public:
void Tester(int xx, int yy = 5)
{
x = xx;
y = yy;
cout<< ++x % --y;
}
};
int main()
{
IndiaBix objBix;
objBix.Tester(5, 5);
return 0;
}
[A].The program will print the output 0.
[B].The program will print the output 1.
[C].The program will print the output 2.
[D].The program will print the output garbage value.
Answer: Option C
[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 B