This Java program uses a for loop to print the numbers from 1 to 10. It initializes an integer variable a to 1, uses a for loop to iterate while a is less than or equal to 10, prints the value of a inside the loop, and increments a by 1 each iteration. The output displays the numbers 1 through 10 printed on separate lines as expected from the for loop.
This Java program uses a for loop to print the numbers from 1 to 10. It initializes an integer variable a to 1, uses a for loop to iterate while a is less than or equal to 10, prints the value of a inside the loop, and increments a by 1 each iteration. The output displays the numbers 1 through 10 printed on separate lines as expected from the for loop.
This Java program uses a for loop to print the numbers from 1 to 10. It initializes an integer variable a to 1, uses a for loop to iterate while a is less than or equal to 10, prints the value of a inside the loop, and increments a by 1 each iteration. The output displays the numbers 1 through 10 printed on separate lines as expected from the for loop.