Complete code:
import java.util.*;
public class Main {
public static void main(String[] args) {
int i = 10;
do {
for (int j = i / 2; j > 0; j--) {
System.out.print(j + " ");
}
System.out.println(); // For a new line after each loop iteration
i -= 2;
} while (i > 0);
}
}
Output:
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
This section is not available anymore. Please use the main Exam Page.1z0-819 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
alphapr
2 months, 1 week agod7bb0b2
9 months, 2 weeks agokvarpe
11 months, 2 weeks agojames2033
11 months, 4 weeks agocuriouss
1 year, 1 month agocuriouss
1 year, 1 month agoqulyt
1 year, 2 months agoLebannin
1 year, 2 months agomuzire
1 year, 2 months agoMtandwa
1 year, 4 months agoStavok
1 year, 4 months agotyfah
1 year, 4 months agobharathdave
1 year, 5 months agoArvind_Kumar_Avinash
1 year, 5 months agokavithaprasanth
1 year, 6 months agoAnotherJavaGuy
1 year, 7 months agoGuru_01
1 year, 8 months ago