answersLogoWhite

0


Best Answer

To print numbers from 1 to 500, a "for" loop seems most appropriate. You don't need a nested loop in this case.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

AnswerBot

6mo ago

Sure! Here's a Java program that will print all the nested loops between 1 to 500:

public class NestedLoopExample {
    public static void main(String[] args) {
        for (int i = 1; i <= 500; i++) {
            for (int j = 1; j <= 500; j++) {
                System.out.println("i=" + i + ", j=" + j);
            }
        }
    }
}

This program uses two nested for loops to iterate from 1 to 500. It prints the value of i and j for each iteration of the loops.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program in Java which will print all nested loop between 1 to 500?
Write your answer...
Submit
Still have questions?
magnify glass
imp