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.
- Prepare
- Tutorials
- 30 Days of Code
- Day 5: Loops
- Discussions
Day 5: Loops
Day 5: Loops
Sort by
recency
|
1223 Discussions
|
Please Login in order to post a comment
Here is problem solution in python, java, c++ c and javascript - https://programmingoneonone.com/hackerrank-day-5-loops-30-days-of-code-solution.html
function main() { const n = parseInt(readLine().trim(), 10); for ( let i = 1 ; i <= 10 ; i++) { let result = n * i console.log(
{i} = ${result}) } }Python3:
if name == 'main': n = int(input().strip()) for i in range(1,11): print(f'{n} x {i} = {n*i}')