// Input side length of square cout << "Enter the side length of the square: "; cin >> side; // Calculate area and perimeter of square area = side * side; perimeter = 4 * side; // Display the area and perimeter of square cout << "Area of the square: " << area << endl; cout << "Perimeter of the square: " << perimeter << endl; return 0;
using namespace std;
int main() {
// Input side length of squarefloat side, area, perimeter;
cout << "Enter the side length of the square: ";
cin >> side;
// Calculate area and perimeter of square
area = side * side;
perimeter = 4 * side;
// Display the area and perimeter of square
cout << "Area of the square: " << area << endl;
cout << "Perimeter of the square: " << perimeter << endl;
return 0;
}