# 10 days Javascript: Let and Const

# Day 1: Let and Const

Solution for:

https://www.hackerrank.com/challenges/js10-let-and-const/problem

## Task

- Declare a constant variable,
`PI`

, and assign it the value`Math.PI`

. You will not pass this challenge unless the variable is declared as a constant and named`PI`

(uppercase). - Read a number,
`r`

, denoting the radius of a circle from stdin. - Use
`PI`

and to calculate the`area`

and`perimeter`

of a circle having radius r. - Print
`area`

as the first line of output and print`perimeter`

as the second line of output.

```
function main() {
// Write your code here. Read input using 'readLine()'
// Print output using 'console.log()'.
const PI = Math.PI;
const r = readLine();
// Print the area of the circle:
var area = PI * (r * r);
console.log(area);
// Print the perimeter of the circle:
var perimeter = 2 * PI * r;
console.log(perimeter);
}
```