Answers for "how to write a while loop"

22

how to write a while statement in python

myvariable = 10
while myvariable > 0:
  print(myvariable)
  myvariable -= 1
Posted by: Guest on January-08-2020
1

while loop

Create a loop that runs as long as i is less than 10.

var i = 0;

while(i < 10) {
	console.log(i); i++
}
Posted by: Guest on June-10-2021
0

Example of a Do..While Loop

public class Test {

   public static void main(String args[]) {
      int x = 10;

      do {
         System.out.print("value of x : " + x );
         x++;
         System.out.print("n");
      }while( x < 20 );
   }
}
Posted by: Guest on August-31-2021

Code answers related to "how to write a while loop"

Python Answers by Framework

Browse Popular Code Answers by Language