#C12790. Circle Area and Circumference Calculator
Circle Area and Circumference Calculator
Circle Area and Circumference Calculator
You are given a single input representing the radius of a circle. Your task is to calculate both the area and the circumference of the circle.
The formulas are given by:
- Area: \( \pi r^2 \)
- Circumference: \( 2\pi r \)
If the input radius is negative or not a valid number, output an error message: Invalid radius
.
inputFormat
The input consists of a single line containing a string that should represent a non-negative floating-point number.
outputFormat
If the input is a valid non-negative number, print two lines: the first line is the area and the second line is the circumference of the circle. Both values are computed using the formulas:
- Area: \( \pi r^2 \)
- Circumference: \( 2\pi r \)
If the input is invalid (i.e. negative or non-numeric), print 'Invalid radius'.
## sample5
78.53981633974483
31.41592653589793
</p>