Problem: circle area and perimeter

Write a program that reads from the console a number r and calculates and prints the circle's area and perimeter with radius r.

Input and output

Input Output
3 Area = 28.2743338823081
Perimeter = 18.8495559215388
4.5 Area = 63.6172512351933
Perimeter = 28.2743338823081

Hints and Guideliness

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.bg/Contests/Practice/Index/504#5.

results matching ""

    No results matching ""