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

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

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

#include
class BixTeam
{
int x, y;
public:
BixTeam(int xx)
{
x = ++xx;
}
void Display()
{
cout<< --x << " "; } }; int main() { BixTeam objBT(45); objBT.Display(); int *p = (int*)&objBT; *p = 23; objBT.Display(); return 0; }

[A].45 22
[B].46 22
[C].45 23
[D].46 23

Answer: Option A