Convert the following do…while loop to for loop:

int x = 10;
do
{
x––;
System.out.print(x);
}

Single Choice
Views 50

Answer:


for(int x = 9; x >= 0; x--)
{
    System.out.print(x);
}

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.