Sort by

recency

|

1225 Discussions

|

  • + 0 comments

    C++

        if (n >= 2 && n <= 20){  //Constraints for n
        for(int i = 1; i <= 10; i++){ //Basic loop I pasted from a notepad I have
           int results=n*i;// intialization of results 
           printf("%d x %d = %d\n",n,i,results);// Print statement
            }
        }
        return 0;
    }
    
  • + 0 comments

    if name == 'main': n = int(input().strip()) for i in range(1,11): print(f"{n} x {i} = {n*i}")

  • + 0 comments
    • if name == 'main':
    • n = int(input().strip())
    • for i in range(1,11):
    • print(f"{n} x {i} = {n*i}")
    • *
  • + 0 comments

    Here is problem solution in python, java, c++ c and javascript - https://programmingoneonone.com/hackerrank-day-5-loops-30-days-of-code-solution.html

  • + 0 comments

    function main() { const n = parseInt(readLine().trim(), 10); for ( let i = 1 ; i <= 10 ; i++) { let result = n * i console.log({i} = ${result}) } }