Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class CArea {
- int x, y;
- public:
- void set_values (int,int);
- int area () {return (x*y);}
- }
- void CArea::set_values (int a, int b) {
- x = a;
- y = b;
- }
- int main ()
- {
- CArea rect;
- rect.set_values (3,4);
- cout << rect.area();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement