Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- While loops are simple. They accept a condition and repeatedly executes until the condition is false.
- int number = 0;
- while(number < 10) {
- }
- 1. The condition is checked first
- 2. If true, execute the code.
- 3. Repeat until condition is false
- If we dont decrease the value stored in number, the loop will go on forever.
- while(number < 10) {
- number++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement