We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 1: Let and Const
Day 1: Let and Const
+ 0 comments function main() { const PI=Math.PI // Print the area of the circle: let r=readLine() console.log(PI*r*r) // Print the perimeter of the circle: console.log(2*PI*r)
+ 0 comments const PI = Math.PI; let r = readLine(); let area; area = PI*r*r; console.log(area); let perimeter; perimeter = PI*r*2; console.log(perimeter);
+ 0 comments function main() { // Write your code here. Read input using 'readLine()' and print output using 'console.log()'. const PI = Math.PI; let r = readLine() // Print the area of the circle: const pis = Math.pow(r,2); let ac = PI * pis; console.log(ac); // Print the perimeter of the circle: let pc = 2*PI * r; console.log(pc);``
+ 0 comments why I'm getting 0 as 3rd line?
+ 0 comments function main() { const PI=Math.PI; let r=readLine(); // Print the area of the circle: let area; area=PI*(r**2); console.log(area); // Print the perimeter of the circle: let perimeter; perimeter=2*PI*r ; console.log(perimeter);
Load more conversations
Sort 182 Discussions, By:
Please Login in order to post a comment