006-002-005
Nested For: Number Table
Easy
Problem Description
Nested For: Number Table
In this problem, you will create a program that uses nested for loops to generate a grid of row-column coordinate pairs (in "row-column" format) and displays the result to standard output.
Learning Objective: Create 2D pattern with nested for loops
Create program that inputs rows and columns and creates number table displaying coordinates. Display "row-column" in each cell.
Input
Line 1: Row count (integer)
Line 2: Column count (integer)
Output
1-1 1-2 1-3 ...
2-1 2-2 2-3 ...
...
```java
(display row-column in each cell, space-separated)
## Examples
### Example 1: 2 rows 3 columns
Input:
```java
2
3
```java
Output:
```java
1-1 1-2 1-3
2-1 2-2 2-3
```java
### Example 2: 3 rows 2 columns
Input:
```java
3
2
```java
Output:
```java
1-1 1-2
2-1 2-2
3-1 3-2
```java
### Example 3: 1 row 1 column (minimum)
Input:
```java
1
1
```java
Output:
```java
1-1
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