int main() { float length, width, area, perimeter;
cout << "Enter the length of the rectangle: "; cin >> length; cout << "Enter the width of the rectangle: "; cin >> width; area = length * width; perimeter = 2 * (length + width); if (area > perimeter) { cout << "The area of the rectangle is greater than the perimeter."; } else if (perimeter > area) { cout << "The perimeter of the rectangle is greater than the area."; } else { cout << "The area and perimeter of the rectangle are equal."; } return 0;
using namespace std;
int main() {
cout << "Enter the length of the rectangle: ";float length, width, area, perimeter;
cin >> length;
cout << "Enter the width of the rectangle: ";
cin >> width;
area = length * width;
perimeter = 2 * (length + width);
if (area > perimeter) {
cout << "The area of the rectangle is greater than the perimeter.";
} else if (perimeter > area) {
cout << "The perimeter of the rectangle is greater than the area.";
} else {
cout << "The area and perimeter of the rectangle are equal.";
}
return 0;
}