Loading...
Loading...
Loading...
A Class 3 teacher wants a table card for any number. Read n and print its multiplication table from 1 to 10 in the form n x i = answer.
n x i = p, where p is n times i.Example
Input
7
Output
7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35 7 x 6 = 42 7 x 7 = 49 7 x 8 = 56 7 x 9 = 63 7 x 10 = 70
The 7 times table.
Try the problem first. Open one hint at a time.
The count is fixed at 10 rows, so a for loop from 1 to 10 fits.
Join the parts with +: n, " x ", i, " = ", n * i.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor