006-002-006
Nested For Loop: Partial Times Table
Medium
Problem Description
Nested For Loop: Partial Times Table
Learning Objective: Write double loops by nesting for statements
Create a program to display part of a multiplication table. Use nested for loops for 2D repetition.
Input
Line 1: Number of rows (integer, 1-3)
Line 2: Number of columns (integer, 1-3)
Output
Display multiplication table with specified rows and columns (space-separated values)
Examples
Example 1
Input:
2
3
Output:
1 2 3
2 4 6
Example 2
Input:
3
3
Output:
1 2 3
2 4 6
3 6 9
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
