Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int rlenone;
  7. int rwidthone;
  8. int rlentwo;
  9. int rwidthtwo;
  10. int rectone;
  11. int recttwo;
  12. rectone = rlenone * rwidthone;
  13. recttwo = rlentwo * rwidthtwo;
  14.  
  15. cout << "What is the length of the first rectangle?";
  16. cin >> rlenone;
  17. cout << "What is the width of the first rectangle?";
  18. cin >> rwidthone;
  19. cout << "What is the length of the secound rectangle?";
  20. cin >> rlentwo;
  21. cout << "What is the width of the secound rectangle?";
  22. cin >> rwidthtwo;
  23.  
  24. if (rectone > recttwo)
  25. cout << "The first rectangle has a larger area.";
  26. else if (rectone < recttwo)
  27. cout << "The secound rectangle has a larger area";
  28. else if (rectone == recttwo)
  29. cout << "The rectangles have the same area!";
  30.  
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement