PRACTICAL:- 11

 Do while loop :

Do while  लूप, while लूप का प्रयोग एक ही प्रकार है जो यह बदलना बताता है कि लूप कम से कम एक बार जरूर एक्सीक्यूट करेगा तथा condition के true होने पर इसको रिपीट करता है। इसका सिंटेक्स है।

do
{
code to be executed
}

<html>
<body>
<script type="text/javascript">
var i=0;
do
{
document.write("the number is" + i);
document.write("<br/>");
i++;
}
while (i<=5);
</script>
</body>
</html>


Output :

The number is 0
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5

एक टिप्पणी भेजें

0 टिप्पणियाँ