#mastery19 Use of loops with “while”

The “while” loop is a loop (duh) that allows us to repeat actions as long as the condition is true or until the condition becomes false.

This code shows a little example of a while loop:

x is equal to cero and what the “while” means is that when x is lower than three, it will print x and it will turn x into an accumulator that adds one every time that the “while” makes a loop unti x becomes equal or greater than three.

 

CC BY 4.0 #mastery19 Use of loops with “while” by Gilberto Rogel García is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.