In Julia, while loop is used to execute a block of statements repeatedly until a given condition is satisfied. And when the condition becomes false, the line immediately after the loop in the program is executed. If the condition is false when the while loop is executed first time, then the body of the loop will never be executed.
while expression statement(s) end
Here, ‘while‘ is the keyword to start while loop, ‘expression‘ is the condition to be satisfied, and ‘end‘ is the keyword to end the while loop.
Note: A block of code is the set of statements enclosed between the conditional statement and the ‘end‘ statement.