-
What is the output of this program?
#include <iostream>
using namespace std;
class First
{
public:
First(int num1 )
{
cout << num1 <<" ";
}
};
class Second: public First
{
public:
Second(int num1, double num2)
: First(num1)
{
cout << num2 <<" ";
}
};
class Third: public Second
{
public:
Third(int num1, double num2, char ch)
: Second(num1, num2)
{
cout <}
};
int main()
{
Third object(6, 5.35, 'I');
return 0;
}
-
- 6 I 5.35
- 6 3.5
- I 5.3 6
- I 6
- 6 5.35 I
Correct Option: E
In this program, We are passing the value and manipulating by using the derived class.