Home / Questions / Convert the following do…while loop to for loop: int x = 10; do { x––; System.out.print(x); }
Explanatory Question

Convert the following do…while loop to for loop:

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

👁 56 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation


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