Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int rlenone;
- int rwidthone;
- int rlentwo;
- int rwidthtwo;
- int rectone;
- int recttwo;
- rectone = rlenone * rwidthone;
- recttwo = rlentwo * rwidthtwo;
- cout << "What is the length of the first rectangle?";
- cin >> rlenone;
- cout << "What is the width of the first rectangle?";
- cin >> rwidthone;
- cout << "What is the length of the secound rectangle?";
- cin >> rlentwo;
- cout << "What is the width of the secound rectangle?";
- cin >> rwidthtwo;
- if (rectone > recttwo)
- cout << "The first rectangle has a larger area.";
- else if (rectone < recttwo)
- cout << "The secound rectangle has a larger area";
- else if (rectone == recttwo)
- cout << "The rectangles have the same area!";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement