learn kro favicon img

Day 5: Loops | HackerRank Solution

Hello coders, today we are going to solve Day 5: Loops HackerRank Solution in C++Java and Python.

Objective

In this challenge, we will use loops to do some math.

Task

Given an integer, n, print its first 10 multiples. Each multiple x i (where 1 <= i <= 10) should be printed on a new line in the form: n x i = result.

Example

n = 3

The printout should look like this:

Input Format

A single integer, n.

Constraints

  • 2 <= n <= 20

Output Format

Print 10 lines of output; each line i (where 1 <= i <= 10) contains the result of n x i in the form:
n x i = result.

Sample Input

Sample Output

Solution – Day 5: Loops

C++

Java

Python

Disclaimer: The above Problem (Day 5: Loops) is generated by Hacker Rank but the Solution is Provided by Learnkro. This tutorial is only for Educational and Learning Purpose.

Leave a Comment

Your email address will not be published. Required fields are marked *