This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We should start from int main() as soon as object of class C is created the compiler goes to class C. There object of class B is created so it goes to class B. There object of class A is created so it goes to class A. Now one by one it starts with the execution of constructor of class A then B and then C. But the destructor is always called opposite to the order of call given to the constructors. So final output will be ABC~C~B~A