❮ Previous Next ❯

do while Loop:

//A do-while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time.
The syntax of a do...while loop is:

Notice that the Boolean expression appears at the end of the loop, so the statements in the loop execute once before the Boolean is tested.
If the Boolean expression is true, the flow of control jumps back up to do, and the statements in the loop execute again. This process repeats until the Boolean expression is false.


public class Test
public static void main(String args[])
int x = 10;
System.out.print("value of x : " + x );
}while( x < 20 );
value of x : 10
value of x : 11
value of x : 12
value of x : 13
value of x : 14
value of x : 15
value of x : 16
value of x : 17
value of x : 18
value of x : 19 ❮ Previous Next ❯


Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Email: info@silantechnology.com
      Phone: 0674-2361252
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved