Write a C++ Program using concept of single Inheritance.


SUBMITTED BY: Nrupeshsinh

DATE: June 26, 2016, 4:24 a.m.

FORMAT: C++

SIZE: 318 Bytes

HITS: 484

  1. # include<iostream.h>
  2. # include<conio.h>
  3. class A
  4. {
  5. public:
  6. void show()
  7. {
  8. cout<<"We are in base class."<<endl;
  9. }
  10. };
  11. class B : public A
  12. {
  13. public:
  14. void display()
  15. {
  16. cout<<"We are in derived class.";
  17. }
  18. };
  19. void main()
  20. {
  21. clrscr();
  22. B obj;
  23. obj.show();
  24. obj.display();
  25. getch();
  26. }

comments powered by Disqus