adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #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.

None of the mentioned

Answer: (a).54.3R

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?