Multiplication Table Generator - Problem
Generate and display the multiplication table for a given number from 1 to 12 in a formatted grid layout.
The table should show each multiplication result in the format: number × i = result where i ranges from 1 to 12.
Each row should be displayed on a separate line with consistent formatting.
Input & Output
Example 1 — Basic Case
$
Input:
number = 7
›
Output:
7 × 1 = 7
7 × 2 = 14
7 × 3 = 21
7 × 4 = 28
7 × 5 = 35
7 × 6 = 42
7 × 7 = 49
7 × 8 = 56
7 × 9 = 63
7 × 10 = 70
7 × 11 = 77
7 × 12 = 84
💡 Note:
Generate multiplication table for 7: each row shows 7 multiplied by numbers 1 through 12
Example 2 — Single Digit
$
Input:
number = 3
›
Output:
3 × 1 = 3
3 × 2 = 6
3 × 3 = 9
3 × 4 = 12
3 × 5 = 15
3 × 6 = 18
3 × 7 = 21
3 × 8 = 24
3 × 9 = 27
3 × 10 = 30
3 × 11 = 33
3 × 12 = 36
💡 Note:
Multiplication table for 3 showing all results from 3×1 to 3×12
Example 3 — Edge Case with 1
$
Input:
number = 1
›
Output:
1 × 1 = 1
1 × 2 = 2
1 × 3 = 3
1 × 4 = 4
1 × 5 = 5
1 × 6 = 6
1 × 7 = 7
1 × 8 = 8
1 × 9 = 9
1 × 10 = 10
1 × 11 = 11
1 × 12 = 12
💡 Note:
Special case where multiplying by 1 gives the sequence 1 through 12
Constraints
- 0 ≤ number ≤ 100
- Output must include all 12 rows
- Each row format: 'number × i = result'
Visualization
Tap to expand
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code