This Java code uses nested for loops to print the numbers 1 through 5 on the first line, then again on the second line, and so on for 5 lines. The outer for loop iterates 5 times, and on each iteration the inner for loop prints the numbers 1 through 5, followed by a newline.
This Java code uses nested for loops to print the numbers 1 through 5 on the first line, then again on the second line, and so on for 5 lines. The outer for loop iterates 5 times, and on each iteration the inner for loop prints the numbers 1 through 5, followed by a newline.
This Java code uses nested for loops to print the numbers 1 through 5 on the first line, then again on the second line, and so on for 5 lines. The outer for loop iterates 5 times, and on each iteration the inner for loop prints the numbers 1 through 5, followed by a newline.
public static void main(String[] args) { for (int i =1; i<=5; i++) { for (int num =1; num<=5; num++) System.out.print(num+" "); System.out.println(" ");