loop with condition at the end: do while, do loop while

condition testing is done at the end of the loop. consequently, the loop is performed at least once. after each iteration the condition is tested, if it is was true. if the specified condition is true, then the loop will continue run, otherwise it will be completed.

do while

Description

do statement while (condition);
Used keywords: do while

Input

Note: here usable statements:
break statement continue statement
compatible programing languages:
C | Visual C++ .NET | C++ | C# | Java | JavaScript | PHP

Examples

Example

even one example in what situations we can use the operation loop with condition at the end:
i=10;
do --i; while ( i > 0);
do {
  i++;
  if (i==5)
    break;
} while ( i <10);

Example

Other pieces of example codes:
do --i; while ( i > 0);

do loop while

Description

do
statements
loop while condition
Used keywords: do while loop

Input

Note: here usable statements:
break statement continue statement
compatible programing languages:
Basic | FreeBASIC | Visual Basic .NET

Examples

Basic

even one example in what situations we can use the operation loop with condition at the end:
i=10
do
 i=i-1
 loop while i > 0
do
  i=i+1
  if i=5 then
    exit do
end if
loop while i <10
loop with condition at the end in another programming language:
Languages: en hu cz sk