31. Multiplication Table
Foundation1000 ms256 MBSolved by 0%
Read an integer n and print its multiplication table from 1 to 10,
one line per row, in this exact format:
n x 1 = n
n x 2 = 2n
...
n x 10 = 10n
Use a lowercase x with a space either side, and spaces around the =.
Constraints - `-1000 ≤ n ≤ 1000`
Input
A single line containing one integer n.
Output
Print ten lines, each n x i = product, with a lowercase x, a space either side of it, and spaces around the =.
Input3
Output3 x 1 = 3
3 x 2 = 6
3 x 3 = 9
3 x 4 = 12
3 x 5 = 15
3 x 6 = 18
3 x 7 = 21
3 x 8 = 24
3 x 9 = 27
3 x 10 = 30
Noteis a small table
Input1
Output1 x 1 = 1
1 x 2 = 2
1 x 3 = 3
1 x 4 = 4
1 x 5 = 5
1 x 6 = 6
1 x 7 = 7
1 x 8 = 8
1 x 9 = 9
1 x 10 = 10
Noteis the identity table
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution