5.5.4 do..while statement

The do..while statement tests the condition after the loop body executes, therefore the loop body always executes at least once.  During testing, if  the condition is true it repeats the statement for the specified number of times or it terminates the loop execution.

Syntax:

Do
Statement;
While(condition);

 

Sample Programe:

<html>
<body>
<script type =”text/javascript>
Var x = 20;
Do
{
alert (“The number is “ + x );
x++;
}
While (x<=10);
</script>
</body>
</html>

 

Sign-up for our email newsletter and get free job alerts, current affairs and GK updates regularly.
Subscribe Here (or)

Leave a Reply

Your email address will not be published. Required fields are marked *


× 4 = thirty two

Popup Dialog Box Powered By : XYZScripts.com
  • RSS
  • Facebook
  • Google+
  • Twitter