Cpp Programming Quiz 221 – A union that has no constructor can be initialized with another union of __________ type.
[A].
different
[B].same
[C].
virtual
[D].
class
Answer: Option B
Explanation:
No answer description available for this question.
virtual
[D].
class
Answer: Option B
Explanation:
No answer description available for this question.
#include
class Bix
{
int x, y;
public:
void show(void);
void main(void);
};
void Bix::show(void)
{
Bix b;
b.x = 2;
b.y = 4;
cout<< x << " " << y;
}
void Bix::main(void)
{
Bix b;
b.x = 6;
b.y = 8;
b.show();
}
int main(int argc, char *argv[])
{
Bix run;
run.main();
return 0;
}
[A].2 4
[B].6 8
[C].The program will report error on Compilation.
[D].The program will report error on Linking.
Answer: Option B
The program will print the output Int .
[C].
The program will print the output Float .
[D].
The program will print the output Final .
Answer: Option B
Explanation:
No answer description available for this question.
Answer: Option B
Answer: Option C
#include
class BixBase
{
int x, y;
public:
BixBase(int xx = 10, int yy = 10)
{
x = xx;
y = yy;
}
void Show()
{
cout<< x * y << endl;
}
};
class BixDerived : public BixBase
{
private:
BixBase objBase;
public:
BixDerived(int xx, int yy) : BixBase(xx, yy)
{
objBase.Show();
}
};
int main()
{
BixDerived objDev(10, 20);
return 0;
}
[A].The program will print the output 100.
[B].The program will print the output 200.
[C].The program will print the output Garbage-value.
[D].The program will report compile time error.
Answer: Option A
Answer: Option D