Advertisement
TechOPGOHIL

Untitled

Dec 3rd, 2023
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. //single in heritance
  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. void main ()
  22. {
  23.     clrscr();
  24.     b obj;
  25.     obj.funca();
  26.     obj.funcb();
  27.     getch();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement