Practice #5

Download code here

What is the output of the following code?

		#include 
		using namespace std;

		class A
		{
		public:
			A ()
				: x (0)
			{ cout<<"A constructor\n"; }
			void Print () const
			{ cout<< x<< endl;}

		private:
			int x;
		};

		class B : public A
		{
		public:
			B ()
				: x (1)
			{ cout<< "B constructor\n"; }
			
		private:
			int x;
		};

		class C : public B
		{
		public:
			C ()
				: x (2)
			{ cout<< "C constructor\n"; }

		private:
			int x;
		};

		void main ()
		{
			A a;
			B b;
			C c;

			a.Print ();
			b.Print ();
			c.Print ();
		}