1. Determine the output of each of the following program when it is executed. (a) #include using namespace std; class abc { public: abc(); class x { public: x(); class y{ public: y(); }; }; }; abc::...




1. Determine the output of each of the following program when it is executed. (a)


#include using namespace std; class abc {


public:


abc(); class x {


public:


x();


class y{


public:


y();


};


};


};


abc:: abc()


{


cout <>


}


abc::x :: x()


{


cout <>


}


abc::x:: y:: y()


{


cout <>


}


int main()


{








}


(b)




abc obj; return 0;




#include using namespace std; class abc {


public:


abc(); class x {


public:


x();


};


};


abc:: abc()


{








cout <>


}


abc::x :: x()


{


cout <>


}




int main()


{








}


(c)




abc::x obj2; return 0;




#include using namespace std; union abc {


~abc(); union x {


~x(); union y {


~y(); union z {


~z();


};


};


};


};




abc:: ~abc()


{


cout <>


}




abc::x :: ~x()


{


cout <>


}




abc::x ::y :: ~y()


{


cout <>


}




abc::x ::y :: z :: ~z()


{


cout <>


}




int main()


{


abc obj1; abc::x obj2; abc::x::y obj3;


abc::x::y::z obj4; return 0;


}






(d)


#include using namespace std; union abc {


~abc(); struct x {


~x(); union y {


~y(); struct z {


~z();


};


};


};


};




abc:: ~abc()


{


cout <>


}




abc::x :: ~x()


{


cout <>


}




abc::x ::y :: ~y()


{


cout <>


}




abc::x ::y :: z :: ~z()


{


cout <>


}




int main()


{


abc obj1; abc::x obj2; abc::x::y obj3;


abc::x::y::z obj4; return 0;


}










May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here