232,277 views
15 votes
15 votes
10. Rewrite this loop into a "for” loop:

int number = 6;
while (number > 0) {
number 3;
System.out.print(number + " ");
}

User Pavel Zdarov
by
2.7k points

1 Answer

6 votes
6 votes

Answer:

for (int number = 6; number > 0; number-=3) {

System.out.print(number + " ");

}

Step-by-step explanation:

User Hammad Akhwand
by
2.3k points