cout << "Enter the radius of the circle: "; cin >> R; cout << "Enter the side length of the equilateral triangle: "; cin >> A; double side = (sqrt(3) / 2) * A; // Calculate the side length of the inscribed equilateral triangle if (side <= 2 * R) { cout << "The equilateral triangle with side length " << A << " can fit inside the circle with radius " << R << "." << endl; } else { cout << "The equilateral triangle with side length " << A << " cannot fit inside the circle with radius " << R << "." << endl; } return 0;
using namespace std;
int main() {
cout << "Enter the radius of the circle: ";double R, A;
cin >> R;
cout << "Enter the side length of the equilateral triangle: ";
cin >> A;
double side = (sqrt(3) / 2) * A; // Calculate the side length of the inscribed equilateral triangle
if (side <= 2 * R) {
cout << "The equilateral triangle with side length " << A << " can fit inside the circle with radius " << R << "." << endl;
} else {
cout << "The equilateral triangle with side length " << A << " cannot fit inside the circle with radius " << R << "." << endl;
}
return 0;
}