Cpp Programming Quiz 179 – Which of the following function declaration is/are incorrect?
[B]. int Sum(int a = 5, int b);[C]. int Sum(int a = 0, int b, int c = 3);
[D]. Both B and C are incorrect.
Answer: Option D
Answer: Option D
#include
class Base
{
int x, y, z;
public:
Base()
{
x = y = z = 0;
}
Base(int xx, int yy = 'A', int zz = 'B')
{
x = xx;
y = x + yy;
z = x + y;
}
void Display(void)
{
cout<< x << " " << y << " " << z << endl;
}
};
class Derived : public Base
{
int x, y;
public:
Derived(int xx = 65, int yy = 66) : Base(xx, yy)
{
y = xx;
x = yy;
}
void Display(void)
{
cout<< x << " " << y << " ";
Display();
}
};
int main()
{
Derived objD;
objD.Display();
return 0;
}
[A].The program will report compilation error.
[B].The program will run successfully giving the output 66 65.
[C].The program will run successfully giving the output 65 66.
[D].The program will run successfully giving the output 66 65 65 131 196.
Answer: Option C
Answer: Option A
Answer: Option C
Answer: Option B
can be overloaded
[C].
can be called
[D].
can be nested
Answer: Option B
Explanation:
No answer description available for this question.
A destructor has a different name than the class in which it is present.
[C].
A destructor always returns an integer.
[D].
A destructor can be overloaded.
Answer: Option A
Explanation:
No answer description available for this question.