Page not loading? Try clicking here.
Placeholder

#139
Language restricted

For - Formative Assessment 10 1s 32MB

Problems

Write a program that receives two numbers between 2 and 9 and prints the multiplication tables between the two numbers.

However, you must print starting from the multiplication table of the number that was entered first, following the format below.

The space between the multiplication tables is three spaces.


Output

Print a total of nine lines from the 1-times table to the 9-times table.
For each multiplication result, if the value has two digits, print it as it is; if it has one digit, add one space in front of it.

This can be easily done by using a format specifier such as "%2d".


Example

5 3
5 * 1 =  5   4 * 1 =  4   3 * 1 =  3

5 * 2 = 10 4 * 2 = 8 3 * 2 = 6
5 * 3 = 15 4 * 3 = 12 3 * 3 = 9
5 * 4 = 20 4 * 4 = 16 3 * 4 = 12
5 * 5 = 25 4 * 5 = 20 3 * 5 = 15
5 * 6 = 30 4 * 6 = 24 3 * 6 = 18
5 * 7 = 35 4 * 7 = 28 3 * 7 = 21
5 * 8 = 40 4 * 8 = 32 3 * 8 = 24
5 * 9 = 45 4 * 9 = 36 3 * 9 = 27

Source

자기주도C언어프로그래밍

You must sign in to write code.