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


SUBMITTED BY: Nrupeshsinh

DATE: June 30, 2016, 2:28 p.m.

FORMAT: Text only

SIZE: 312 Bytes

HITS: 397

  1. # include<iostream.h>
  2. # include<conio.h>
  3. class A
  4. {
  5. public:
  6. int a,b;
  7. void show()
  8. {
  9. cout<<"Enter value of A=";
  10. cin>>a;
  11. cout<<"Enter value of B=";
  12. cin>>b;
  13. }
  14. };
  15. class B : public A
  16. {
  17. public:
  18. void display()
  19. {
  20. cout<<"Sum="<<a+b;
  21. }
  22. };
  23. void main()
  24. {
  25. clrscr();

comments powered by Disqus