Написать программу которая определяет ,что больше площадь или периметр и вывести ответ на экран

18 Сен 2019 в 23:42
197 +1
0
Ответы
1
include

using namespace std;

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;

}

19 Апр 2024 в 21:51
Не можешь разобраться в этой теме?
Обратись за помощью к экспертам
Гарантированные бесплатные доработки в течение 1 года
Быстрое выполнение от 2 часов
Проверка работы на плагиат
Поможем написать учебную работу
Прямой эфир