Source Code : Program On Contact

//......Program On Contact.cpp……//

#include

using namespace std;

class overload

{

    int a,b;

  public:

    void getdata(int x,int y)

    {

  a=x;

  b=y;

    }

    void display(void);

/*    void overload(int p,int q)

    {

  p=a; q=b;

    }*/

    void operator-();

};

/*overload overload::operator+(overload c)

{

  overload temp;

  temp.x=x+c.x;

//  temp y=y+c.y;

  return(temp);

}*/

void overload::display(void)

{

  cout<<"X= "<

  cout<<"\nY= "<

  cout<<"Z= ("<

}

void overload:: operator-()

{

  a=-a;

  b=-b;

}

int main()

{

  overload op;//o1,o2,o3;

  op.getdata(-45,30);

  op.display();

  -op;

  cout<<"After reversing, the data is:\n";

  op.display();

  return 0;

}