2. What will be the output of each of the following program when it is executed? (a) #include using namespace std; union abc { abc() { cout } }; int main() { } (b) abc obj; return 0; ...




2. What will be the output of each of the following program when it is executed? (a)


#include using namespace std; union abc


{


abc() {


cout <>


}


};


int main()


{
















}


(b)




abc obj; return 0;




#include using namespace std; struct abc


{


abc() {


cout <>


}


};


int main()


{








}


(c)




abc obj; return 0;




#include using namespace std; struct abc


{


~abc() {


cout <>


}


};


int main()


{








}


(d)




abc obj; return 0;




#include using namespace std; struct abc


{


~abc() {


cout <>


}


};


int main()


{








}


(e)




abc obj; return 0;




#include using namespace std; struct abc


{


virtual ~abc() {


cout <>








}


};


int main()


{








}


(f)




abc obj; return 0;




#include using namespace std; struct abc


{


virtual abc() {


cout <>


}


};


int main()


{








}


(g)




abc obj; return 0;




#include using namespace std; struct abc {


abc();


};




abc :: abc()


{


struct sample {


sample() {


cout <>


}


};


}


int main()


{








}



(b)




abc obj; return 0;




#include using namespace std; struct abc {


abc();


};




abc :: abc()


{


struct sample {


sample();


};


}


abc::sample :: sample()






{


cout <>


}


int main()


{


abc obj; return 0;


}














May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here