-
What is the output of this program?
#include <iostream>
using namespace std;
class classA
{
public:
virtual ~classA(){}
protected:
char p;
public:
char getChar();
};
class classB : public classA
{
public:
void printChar();
};
void classB::printChar()
{
cout << "False" << endl;
}
int main()
{
classB ch;
ch.printChar();
return 1;
}
-
- True
- False
- Runtime Error
- Compilation Error
- None of these
Correct Option: B
In this program, We are passing the values and inheriting it to the other class and printing the result.