#include <iostream> #include <cmath> int main() { double A; std::cout << "Enter the side length of the square: "; std::cin >> A; double area = A * A; double perimeter = 4 * A; double diagonal = sqrt(2) * A; std::cout << "Area of the square: " << area << std::endl; std::cout << "Perimeter of the square: " << perimeter << std::endl; std::cout << "Length of the diagonal of the square: " << diagonal << std::endl; return 0; }
#include <cmath>
int main() {
double A;
std::cout << "Enter the side length of the square: ";
std::cin >> A;
double area = A * A;
double perimeter = 4 * A;
double diagonal = sqrt(2) * A;
std::cout << "Area of the square: " << area << std::endl;
std::cout << "Perimeter of the square: " << perimeter << std::endl;
std::cout << "Length of the diagonal of the square: " << diagonal << std::endl;
return 0;
}