Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class CArea {
  5. int x, y;
  6. public:
  7. void set_values (int,int);
  8. int area () {return (x*y);}
  9. }
  10.  
  11.  
  12. void CArea::set_values (int a, int b) {
  13. x = a;
  14. y = b;
  15. }
  16.  
  17. int main ()
  18. {
  19. CArea rect;
  20. rect.set_values (3,4);
  21. cout << rect.area();
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement