Circle
Lesson 12 of 32 in Coddy's Coding Problems course.
Your task is to calculate the perimeter and area of a circle. You will be given its radius, and using the number pi (π) output the wanted calculations.
Challenge
EasyWrite a program that gets a natural number R representing the radius of the circle you need to calculate and outputs its perimeter and area as decimal numbers rounded to the third digit.
For the value of pi use π = 3.142.
Input
2
Output
12.568 12.568
Input
3
Output
18.852 28.278
Try it yourself
#include <stdio.h>
int main() {
// Write code here
return 0;
}
All lessons in Coding Problems
1Course Introduction
Introduction