Answers for "while and do while loops"

1

While Loop

A while loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true. 

Syntax : 
while(Boolean_expression) {
   // Statements
}
Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and true is any non zero value. 

When executing, if the boolean_expression result is true, then the actions inside the loop will be executed. This will continue as long as the expression result is true.

When the condition becomes false, program control passes to the line immediately following the loop.
Posted by: Guest on August-31-2021
0

while syntax

while(booleanExpression) { 
    //block of code to be executed
}
Posted by: Guest on June-25-2021

Browse Popular Code Answers by Language