
public class NestedLoops {

	public static void main(String[] args) {
		// nested loops - loops within loops
		final int MAX = 10;
		
		//for each row
		for(int row = 1; row <= MAX; row++) {
			//print one row of these (one line)
			//for each column
			for(int col = 1; col <= MAX; col++) {
				//one column
				//print one
				System.out.printf("( %3d, %3d )", row, col);
			}
			//end of line
			System.out.println();

		}
		System.out.println("-----------------------------------------------------");
		
		//for each row
		for(int row = 1; row <= MAX; row++) {
			//print one row of these (one line)
			//for each column
			for(int col = 1; col <= row; col++) {
				//one column
				//print one
				System.out.printf("( %3d, %3d )", row, col);
			}
			//end of line
			System.out.println();

		}
		System.out.println("-----------------------------------------------------");
		
		//for each row
		for(int row = 1; row <= MAX; row++) {
			//print one row of these (one line)
			//for each column
			for(int col = 1; col <= MAX - row + 1; col++) {
				//one column
				//print one
				System.out.printf("( %3d, %3d )", row, col);
			}
			//end of line
			System.out.println();

		}
		System.out.println("-----------------------------------------------------");
		
		
		//multiplication table
		for(int row = 1; row <= MAX; row++) {
			//print one row of these (one line)
			//print the row header
			System.out.printf("%3d|", row);
			
			//for each column
			for(int col = 1; col <= MAX; col++) {
				//one column
				//print one
				System.out.printf("%3d ", row*col);
			}
			//end of line
			System.out.println();

		}
		System.out.println("-----------------------------------------------------");
		
	}

}
