while loop

while loops

While loop is another type of loops that can be used in Java. We put the condition first and then according to the condition, the subsequent statement is executed. Let’s see syntax of while loop: while(condition) { /*Statement to be executed;*/ /*iteration;*/ } Program to print multiples of 3 between range 3-100. package practice_udemy_java; public… read more »

while loop

While loop¬†keeps on executing the given statements as long as the condition is true.When the condition ¬†turns out to be false then set of statements in the block never gets executed and the control goes to first line after the while block. Syntax while(condition) { set_of_statements; iteration statement; } If the condition is true,then set… read more »