What will be the output of the following C++ code? [code] #include <iostream> using namespace std; class A { public:

What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    class A
    {
        public:
        A(int n )
        {
            cout << n;
        }
    };
    class B: public A
    {
        public:
        B(int n, double d)
        : A(n)
        {
            cout << d;
        }    
    };
    class C: public B
    {
        public:
        C(int n, double d, char ch)
        : B(n, d)
        {
            cout <<ch;
        }
    };
    int main()
    {
        C c(5, 4.3, 'R');
        return 0;
    }
A. 54.3R
B. R4.35
C. 4.3R5
D. R2.6
 

Tìm kiếm

Back
Top