#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
class add
{
private: int a,b;
public:
add()
{
a=b=0;
}
void input()
{
cout<<"enter value of a";
cin>>a;
cout<<"enter value of b";
cin>>b;
}
void show()
{
cout<<"value ofa"<<a;
cout<<"value of b"<<b;
}
add operator +(add p)
{
add temp;
temp.a=p.a+a;
temp.b=p.b+b;
return temp;
}
};
void main()
{
add x,y,z;
x.input();
y.input();
x.show();
y.show();
z=x+y;
z.show();
getch();
}
Posted by Unknown On Wednesday, February 20, 2013 No comments

0 comments:

Post a Comment

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Like us

    as

    Contact Form

    Name

    Email *

    Message *