Cpp Programming Quiz 42 – Reference is like a _____.
[B]. Structure[C]. Macro
[D]. Enum
Answer: Option A
Answer: Option A
Answer: Option B
#include
int BixFunction(int a, int b = 3, int c = 3)
{
cout<< ++a * ++b * --c ;
return 0;
}
int main()
{
BixFunction(5, 0, 0);
return 0;
}
[A].8
[B].6
[C].-6
[D].-8
Answer: Option C
#include
static int Result;
class India
{
public:
void Change(int x = 10, int y = 20, int z = 30)
{
cout<< x + y + z;
}
void Display(int x = 40, float y = 50.00)
{
Result = x % x;
cout<< Result;
}
};
class Bix
{
int x, y;
public:
void Change(int x, int y = 50)
{
cout<< x + y;
}
};
class IndiaBix: public India, public Bix
{
public:
void Display(int x = 10, int xx = 100, int xxx = 1000)
{
Result = x + xx % x * x;
cout<< Result ;
}
};
int main()
{
IndiaBix objBix;
objBix.India::Display(10, 20.00);
return 0;
}
[A].The program will print the output 0.
[B].The program will print the output 10.
[C].The program will print the output 30.
[D].The program will print the output 40.
Answer: Option A
Constructor cannot be inherited but the derived class can call them.
[C].
A constructor of a derived class cannot access any public and protected member of the base class.
[D].
Both A and B.
Answer: Option D
Explanation:
No answer description available for this question.
Answer: Option D
Answer: Option B
Explanation:
The two main types of polymorphism are run-time (implemented as inheritance and virtual functions), and compile-time (implemented as templates).