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 c++ flowchart?

0 Answers  


What is public, protected, private in c++?

0 Answers  


Can we sort map in c++?

0 Answers  


You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.

4 Answers  


What does '\r' and '\b' mean? Please explain with example.

7 Answers  






Which of the Standard C++ casts can be used to perform a ?safe? downcast: a) reinterpret_cast b) dynamic_cast c) static_cast d) const_cast

2 Answers   Quark,


How is new() different from malloc()?

0 Answers  


How to defines the function in c++?

0 Answers  


how to explain our contribution in the project?

0 Answers   Wipro, Yahoo,


A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.

0 Answers  


What is size of a empty class?

7 Answers   Microsoft, Tata Elxsi, Wipro,


What is the fastest c++ compiler?

0 Answers  


Categories