Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What will be the output of the following code?
int i = 5;
do {
System.out.println(i);
i++;
} while (i < 5);Remember that it executes at least once.
Write a do-while loop that prints 'Hello' three times.
Initialize a counter and increment it within the loop.
What is the key feature of a do-while loop?
Think about how conditions are handled in different loops.
True or False: A do-while loop can execute zero times.
Recall the structure of a do-while loop.
Design a do-while loop that asks users for their preferred fruit until they type 'done'. What should you account for in your loop?
Think about how you'd store responses.
Create a game menu that keeps showing options until a player chooses to quit. Analyze how this could impact usability.
Sketch the menu options and flow for better clarity.
5 more questions in this section. Enroll free to practise them all.
Enroll free