do ... while in javascript

     The do...while statement creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.
     In the following example program the do...while execute at least once.

Syntax

do
{
   statements; 
} while(condition);


Flow chart:
 
Example

var a = 0;
do {
  a = a + 1;
  alert(a);
} while (a < 3);



Example Program:- (Editor)


Editor is Loading...

Advertisement




Tags:
Do while in allinworld99, do while flow chart in allinworld99, javascript do... while in allinworld99.

0 nhận xét:

Đăng nhận xét