PHP <-> Basic | Loop with condition on the beginning

PHP

while

Description

while (condition) statement
Used keywords: while

Input

Note: Here usable statements:
break statement continue statement

Examples

PHP

Loop with condition on the beginning the possible of use:
$i=0;
while ($i<10) ++$i;
$x =0;
while ($i<20)
{
 $i= $i+2;
 if ($i==16)
 {
    continue;
 }
 $x++; 
}
.
Basic

do while loop

Description

do while condition
statements
loop
Used keywords: do while loop

Input

Note: Here usable statements:
break statement continue statement

Examples

Basic

Loop with condition on the beginning the possible of use:
i=0
do while i<10
 i=i+1
loop
x =0
do while i<20
 i= i+2
 if i=16 then
    continue while
 end if
 x=x+1 
loop
PHP

while

Description

while (condition) statement
Used keywords: while

Input

Note: Here usable statements:
break statement continue statement

Examples

PHP

Loop with condition on the beginning the possible of use:
$i=0;
while ($i<10) ++$i;
$x =0;
while ($i<20)
{
 $i= $i+2;
 if ($i==16)
 {
    continue;
 }
 $x++; 
}
.
Basic

while wend

Description

while condition
statements
 wend
Used keywords: while wend

Input

Note: Here usable statements:
break statement continue statement

Examples

Basic

Loop with condition on the beginning the possible of use:
i=0
do while i<10
 i=i+1
loop
x =0
do while i<20
 i= i+2
 if i=16 then
    continue while
 end if
 x=x+1 
loop
Languages: en hu cz sk