006-002-007
Nested Loop: Multiplication Table
Medium
Problem Description
Nested Loop: Multiplication Table
In this problem, you will create a program that uses nested loops (a for loop inside another for loop) to calculate every product in the multiplication table from group 1 through group 9 (each multiplied by 1 through 9) and displays the result to standard output.
Learning Objective: Understand how to generate two-dimensional patterns using nested loops
Overview
Create a program that outputs a multiplication table. The outer loop handles "multiplication groups" and the inner loop handles "calculations within each group".
Specifications
- Output groups from 1 to 9 in order
- In each group, perform multiplication from 1 to 9
- Output format: "[group] x [number] = [result]"
- Separate each calculation result with a newline
Output Format
1 x 1 = 1
1 x 2 = 2
...
1 x 9 = 9
2 x 1 = 2
2 x 2 = 4
...
9 x 9 = 81
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up