ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ 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;
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.