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

Cpp Programming Quiz 107 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
class BixBase
{
public:
float x;
};
class BixDerived : public BixBase
{
public:
char ch;
void Process()
{
ch = (int)((x=12.0)/3.0);
}
void Display()
{
cout<< (int)ch; } }; int main() { class BixDerived *objDev = new BixDerived; objDev->Process();
objDev->Display();
return 0;
}

[A].The program will print the output 4.
[B].The program will print the ASCII value of 4.
[C].The program will print the output 0.
[D].The program will print the output garbage. 

Answer: Option A