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. 30 Days of Code
  4. Day 5: Loops
  5. Discussions

Day 5: Loops

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

Sort 1140 Discussions, By:

recency

Please Login in order to post a comment

  • nadia_abowitz
    24 hours ago+ 0 comments

    JS:

    function main() {
        const n = parseInt(readLine().trim(), 10);
        
        for (let i = 1; i <= 10; i++) {
            console.log(`${n} x ${i} = ${n * i}`)
        }
        
    }
    
    0|
    Permalink
  • stidvu1
    1 week ago+ 0 comments

    import java.text.; import java.util.; import java.util.concurrent.; import java.util.function.; import java.util.regex.; import java.util.stream.; import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList;

    public class Solution { public static void main(String[] args) throws IOException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(bufferedReader.readLine().trim());
        for(int i=1;i<=10;i++)   {
             System.out.println(n+" x "+i+" = "+n*i);
         }
        bufferedReader.close();
    }
    

    }

    0|
    Permalink
  • bagalore
    1 week ago+ 0 comments
        for i in range(1, 11):
            print('{} x {} = {}'.format(n, i, n*i))
    
    0|
    Permalink
  • lucasopoka
    3 weeks ago+ 0 comments

    I like lambdas more :)

    n = int(input())
    print(*map(lambda x:f'{n} x {x} = {x*n}',range(1,11)),sep='\n')
    
    0|
    Permalink
  • esenthooran23031
    1 month ago+ 0 comments

    python 3

    for i in range(1,11) print(n ,"x", i , "=" , (n * i))

    0|
    Permalink
Load more conversations

Need Help?


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