Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class dollar
- {
- int d;
- public:
- int get_data()
- {
- cout<<"\n Enter dollar";
- cin>>d;
- return d;
- }
- };
- class rupee
- {
- int rs;
- public:
- rupee()
- {
- rs=0;
- }
- rupee(dollar d)
- {
- rs=d.get_data()*73;
- }
- void disp()
- {
- cout<<"\n Rupee is "<<rs;
- }
- };
- int main()
- {
- rupee r;
- dollar d;
- r=d;//convestion from one class to another
- r.disp();
- }
Add Comment
Please, Sign In to add comment