Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. //Q1:write the program c++ find Larger between (a,b) using class ...oop c++?
  2. #include<iostream.h>
  3. class max
  4. {
  5. int a,b;
  6. public:
  7. void inputdata(void)
  8. {
  9. cout<<"inter the value"<<endl;
  10. cin>>a>>b;
  11. }
  12. void maxm()
  13. {
  14. if(a>b)
  15. cout<<"the max="<<a;
  16. else
  17. cout<<"the max="<<b;
  18. }
  19. };
  20. void main()
  21. {
  22. max d;
  23. d.inputdata();
  24. d.maxm();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement