Problem: Circle Area and Perimeter
Write a program that reads from the console a number r and calculates and prints the area and perimeter of a circle with radius r.
Input and Output
| Input | Output |
|---|---|
| 3 | Area = 28.2743338823081 Perimeter = 18.8495559215388 |
| 4.5 | Area = 63.6172512351933 Perimeter = 28.2743338823081 |
Video: Circle Perimeter and Area
Watch the video lesson about calculating circle perimeter and area: https://youtu.be/7W6teq9IVGU.
Hints and Guidelines
For the calculations you may use the following formulas:
Area = Math.PI * r * r.Perimeter = 2 * Math.PI * r.
Testing in the Judge System
Test your solution here: https://judge.softuni.org/Contests/Practice/Index/504#5.