Tag Archives: While Loop

JavaScript While Loop

In the previous two JavaScript tutorials, we discuss how can we use the if…else and switch case statements in JavaScript to execute a specific block of code based on single and multiple conditions. In this tutorial, we will learn about the concept of while loop in JavaScript which can execute a block of code again and again based… Read More »

Java While Loop

Unlike for-loop, while loop is used when the number of iteration is not known. The while loop will execute the program several times until the condition is false. Syntax while(condition){ //code to be executed } Example public class WhileExample { public static void main(String[] args) { int i=1; while(i<=3){ System.out.println(i); i++; } } } Output 1 2 3… Read More »

Python While Loop

In this tutorial, we will discuss one more loop which is while loop Python, as like for loop while loop also used to repeat a block of code. In this article, you will code and learn all the concepts of while loop. so let’s discuss Python While Loop. Python While Loop Like for loop while loop is used… Read More »