FirstHack Learn
Log in Sign up free
← All problems

Multiplication Table

Easy 1 solved

Multiplication Table

Given an integer N, print its multiplication table from 1 to 10.

Print exactly ten lines. Line i must look like this, with single spaces around every symbol:

N x i = product

For example, when N is 5 the first line is 5 x 1 = 5 and the last line is 5 x 10 = 50.

💡

Build each line with the same loop variable you multiply by — do not write ten separate print statements.

Input

A single line containing one integer N.

Output

Ten lines of the form "N x i = product" for i from 1 to 10.

Constraints

0 <= N <= 100

Example 1
Input
5
Output
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50

Ten lines, one for each multiplier from 1 to 10.

Submit runs your code against 5 test cases — the 1 shown above plus 4 hidden ones covering the awkward cases. Run sample just tries the first example, which is usually what you want while you are still working it out.