Advertisement
TechOPGOHIL

Untitled

Dec 3rd, 2023 (edited)
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. //multipal inheritance
  2. #include<iostream.h>
  3. #include<conio.h>
  4. class a
  5. {
  6.     public :
  7.     void funca()
  8.     {
  9.         cout<<"\nFunction A is Called";
  10.     }
  11.  
  12. };
  13. class b  : public a
  14. {
  15.     public:
  16.     void funcb()
  17.     {
  18.         cout<<"\nFunction B is Called";
  19.     }
  20. };
  21. class c : public b
  22. {
  23.     public:
  24.     void funcc()
  25.     {
  26.         cout<<"\n Function C is called";
  27.     }
  28. };
  29. void main ()
  30. {
  31.     clrscr();
  32.     c obj;
  33.     obj.funca();
  34.     obj.funcb();
  35.     obj.funcc();
  36.     getch();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement