Tag Archives: While Loop

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, 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. While loop: Like for loop while loop is used to repeat… Read More »