/home/caleb/ASDV-Java/Semester 3/Assignments/lab5-recursion2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5/recursion2_calebfontenot/NestedLoopsIndexes.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package edu.slcc.asdv.caleb.lab5.recursion2_calebfontenot;
@author
public class NestedLoopsIndexes {
static final int ROWS = 3;
static final int COLUMNS = 5;
public static void nestedLoopsIndexesR(int i, int j) {
if (j == COLUMNS) {
System.out.println();
return;
} else if (i == ROWS) {
return;
}
System.out.print(i + ", " + j + " ");
nestedLoopsIndexesR(i, ++j);
if (i + 1 == j) {
nestedLoopsIndexesR(++i, 0);
}
}
public static void main(String[] args)
{
nestedLoopsIndexesR(0, 0);
}
}