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


SUBMITTED BY: Nrupeshsinh

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

FORMAT: C++

SIZE: 444 Bytes

HITS: 533

  1. # include<iostream.h>
  2. # include<conio.h>
  3. class A
  4. {
  5. public:
  6. int a;
  7. void show()
  8. {
  9. cout<<"Enter value of A=";
  10. cin>>a;
  11. }
  12. };
  13. class B
  14. {
  15. public:
  16. int b;
  17. void show1()
  18. {
  19. cout<<"Enter value of B=";
  20. cin>>b;
  21. }
  22. };
  23. class C : public A,public B
  24. {
  25. public:
  26. void display()
  27. {
  28. cout<<"Sum="<<a+b;
  29. }
  30. };
  31. void main()
  32. {
  33. clrscr();
  34. C obj;
  35. obj.show();
  36. obj.show1();
  37. obj.display();
  38. getch();
  39. }

comments powered by Disqus