Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class point
- {
- int x,y;
- public:
- point()
- {
- x=y=0;
- }
- point(int x, int y)
- {
- x=a;
- y=b;
- }
- void display()
- {
- cout<<"Point ("<<x<<" , "<<y<<");
- }
- }:
- int main ()
- {
- point p(3,9), q(2,7),r;
- r= p + q;
- r.display();
- if(p>q)
- {
- r=p-2;
- r.display();
- }
- else
- {
- r=q-r;
- r.display()
- }
- p++;
- p.display();
- ++p;
- p.display();
- q=q*2;
- q.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement