Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Write a simple while loop to print numbers 1 to 3.
Remember to initialize `i` before the loop.
What happens if the condition is always true in a while loop?
Think about what needs to change for the loop to stop.
What is the primary function of a while loop?
Think about what the loop does repeatedly.
True or False: The condition in a while loop is evaluated after the loop body is executed.
Remember the order of operations in a while loop.
Write a program using a while loop to calculate the factorial of a given number input by the user.
Remember how to decrement your number and multiply!
Create a while loop that finds the largest prime number less than 100. Print it out.
Think about how to test for primality.
4 more questions in this section. Enroll free to practise them all.
Enroll free