Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<conio.h>
- using namespace std;
- class shape
- {
- private : int len,br,h;
- public : void read();
- void display();
- void operator++();
- };
- void shape :: read()
- {
- cout<<"Enter value for length breadth height:\n";
- cin>>len>>br>>h;
- }
- void shape :: operator++()
- {
- len++;
- br++;
- h++;
- }
- void shape :: display()
- {
- cout<<"Length= "<<len<<"\nBreadth= "<<br<<"\nHeight= "<<h;
- }
- int main()
- {
- shape s1;
- s1.read();
- s1.display();
- cout<<"\nAfter Incrementing:\n---------------\n";
- ++s1;
- s1.display();
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment