Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Q1:write the program c++ find Larger between (a,b) using class ...oop c++?
- #include<iostream.h>
- class max
- {
- int a,b;
- public:
- void inputdata(void)
- {
- cout<<"inter the value"<<endl;
- cin>>a>>b;
- }
- void maxm()
- {
- if(a>b)
- cout<<"the max="<<a;
- else
- cout<<"the max="<<b;
- }
- };
- void main()
- {
- max d;
- d.inputdata();
- d.maxm();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement