while

While loops through the statements enclosed within the { code block } until the test condition is false:

 

while (test condition {

statements ;

statements ;

}

Displays:

$myVar is currently
$myVar is currently 1
$myVar is currently 2
$myVar is currently 3
$myVar is currently 4

Leave a Reply