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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Tutorials
  3. 10 Days of Javascript
  4. Day 1: Let and Const
  5. Discussions

Day 1: Let and Const

Problem
Submissions
Leaderboard
Discussions
Editorial
Topics

Sort 182 Discussions, By:

recency

Please Login in order to post a comment

  • guptakhushi62201
    11 hours ago+ 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|
    Permalink
  • prasadpatil1123
    3 days ago+ 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|
    Permalink
  • blessvic2013
    4 weeks ago+ 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|
    Permalink
  • manasa4nasa
    3 months ago+ 0 comments

    why I'm getting 0 as 3rd line?

    0|
    Permalink
  • oykuky001
    3 months ago+ 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);
        
    
    0|
    Permalink
Load more conversations

Need Help?


View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy