Vidyalelo
C++ Programming · Q765

C++ miscellaneous

Programming · C++ Programming · question 765

Q765

What will be the output of the following C++ code? #include 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
Answer
B.
R4.35
C.
4.3R5
D.
R2.6

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board