What is the output of this prog. ?


struct A { A(){ cout << \"A\"; } };
struct B { B(){ cout << \"B\"; } };
struct C { C(){ cout << \"C\"; } };
struct D { D(){ cout << \"D\"; } };
struct E : D { E(){ cout << \"E\"; } };
struct F : A, B
{
C c;
D d;
E e;
F() : B(), A(),d(),c(),e() { cout << \"F\"; }
};

Answers were Sorted based on User's Feedback



What is the output of this prog. ? struct A { A(){ cout << \"A\"; } }; struct..

Answer / shikha kataria

this program doesnot contain main() function.
so it cannot run

Is This Answer Correct ?    7 Yes 0 No

What is the output of this prog. ? struct A { A(){ cout << \"A\"; } }; struct..

Answer / amit prakash

der's no main function so it cant run...

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is the v-ptr?

0 Answers  


What is c++ hiding?

0 Answers  


What are the vectors in c++?

0 Answers  


Explain the virtual inheritance in c++.

0 Answers  


What is a dangling pointer?

3 Answers   Glenwood,






"How will you merge these two arrays? Write the program Array: A 1 18 22 43 Array: B 3 4 6 20 34 46 55 Output Array: C 1 3 4 6 18 20 22 34 43 46 55"

9 Answers   College School Exams Tests, HCL,


What are the advantages of using a pointer?

0 Answers  


What are the two types of comments?

0 Answers  


Are strings immutable in c++?

0 Answers  


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

0 Answers  


In c++, what is the difference between method overloading and method overriding?

0 Answers  


Is there finally in c++?

0 Answers  


Categories