C++ Multilevel Inheritance

  c++

Email

#include<iostream>
using namespace std;

class A{

public :

void setname()
{
cout <<“this manin name”;
}
};

class B : public A{

public :

void setdate()
{
cout <<“this data fo the class”;
}
};

class C : public B {

public :

void setage()
{
cout <<“thisma scextio f c”;
}
};

int main()
{
C naik;
naik.setname();
naik.setdate();
naik.setage();

}

Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of