Begin15. The area \(S\) of the circle is given. Find its diameter \(D\) and the length \(L\) of the circle bounding this circle, taking into account that \(L = 2 \cdot \pi \cdot R, \quad S = \pi \cdot R^2\) . For the value of \(\pi\) use 3.14.

Solution in Python 3:

import random
import math

print("Pi:", math.pi)
S = random.randrange(1,100)
R = math.sqrt(S / math.pi)
L = 2 * math.pi * R
print("Radius of the circle: ", R)
print("Area of the circle: ", S)
print("Length of the circle: ", L)

Solution in C++:

#include <iostream>
#include <cmath>
using namespace std;
int main(){
double s, d, l, r, pi = 3.14;
cout << "Enter the area of the circle: ";
cin >> s;
r = sqrt(s/pi);
d = r*2;
l = pi*d;
cout << "Diameter: " << d << endl;
cout << "Length of the circle: " << l;
return 0;
}