Advertisement
AlexLeo

CPPClass

Nov 1st, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. using namespace std;
  4.  
  5. class Rectangle
  6. {
  7. //public:
  8.     int len;
  9.     int width;
  10. };
  11.  
  12. int main()
  13. {
  14.     Rectangle r1;
  15.     r1.len=5;
  16.     r1.width=10;
  17.     cout << "Len=\t" << r1.len << '\n';
  18.     cout << "Width=\t" << r1.width << '\n';
  19.     cout << "Area=\t" << r1.len*r1.width << '\n';
  20.  
  21.     system("pause");
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement