Coding Challenge: Multiplication Table

Learn how to write a code that inputs any random number from the user and returns a multiplication table of that number.

Problem statement

Write a program that asks the user for a number, then show the multiplication table for this number.

Input

Enter a number: 2

Expected output

2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18
2 x 10 = 20

Coding exercise

Get hands-on with 1400+ tech skills courses.