A class inherits its property to another class and another class inherits property to next class and so on, then such type of inheritance known as single inheritance.
In the above diagrams class C is derived class of base class A & B and class B is derived class of base class A. Therefore object of class C can access the public property of base class A & Bas well as its so on.
e.g#include<conio.h> #include<iostream.h> class Student{ protected: int rollno; public: void setRollno(int r){ rollno=r; } void getRollno(){ cout<<"\n Roll No "<<rollno; } }; class Marks:public Student{ protected: int sub1,sub2; public: void setMarks(int m1,int m2){ sub1=m1; sub2=m2; } void getMarks(){ cout<<"\n Subject 1 "<<sub1; cout<<"\n Subject 2 "<<sub2; } }; class Result:public Marks{ int tot; public: void display() { tot=sub1+sub2; getRollno(); getMarks(); cout<<"\nTotal "<<tot; } }; void main() { clrscr(); Result r; r.setRollno(10); r.setMarks(55,66); r.display(); getch(); }