Objective

Create a multiplication table up to 10 for a randomly-chosen positive integer.

Difficulty

Very easy

Description

Let's go random!

In this exercise, you have to randomly come up with a positive integer not above 10, and then create a multiplication table for that integer upto 12.

For instance, if the integer is 5, you'll compute 5 x 1, 5 x 2, ..., all the way upto 5 x 12.

For the output, start with the following line:

The integer is: <integer>

where <integer> is the randomly-chosen integer.

Next up, comes the multiplication table. Leave a blank line before printing the multiplication table.

Each row of the table is to be presented on a new line in the following form:

<integer> x <i> = <product_i>

where <integer> is the randomly-chosen integer, <i> is the multiplier (starting at 1, and incrementing for each new row) and <product_i> is the product of these two numbers.

Shown below is an example to clarify all these outputs:

The integer is: 4 4 x 1 = 4 4 x 2 = 8 4 x 3 = 12 4 x 4 = 16 4 x 5 = 20 4 x 6 = 24 4 x 7 = 28 4 x 8 = 32 4 x 9 = 36 4 x 10 = 40 4 x 11 = 44 4 x 12 = 48