Advertisements
Advertisements
प्रश्न
Write a Java Script program using while statement to display 10 numbers.
दीर्घउत्तर
उत्तर
<html>
<Head>
<Title> Display 10 Numbers in Javascript</Title>
</Head>
<Body>
<script language = “java script” type = “text / java script”>
document.write (“<h2> using while statement </h2>”)
Var no2= 0;
while (no2<=10)
{
document.write (no2+ “ ”);
no2=no2+1;
}
</script>
</body>
</html>
shaalaa.com
Looping / Repetitive
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
APPEARS IN
संबंधित प्रश्न
Which of the following is not a looping statement?
Which part of the loop statement determines the number of times, the loop will be iterated?
In the _____ loop, body of the loop always executed at least once before the condition can be executed.
What is called a loop and what are its types?
Differentiate between while and do while statements.
Explain for loop with example.