Break and continue statement using loop

Suman Barik
0

 // Use this editor to write, compile and run your Java code 


public class HelloWorld {

public static void main(String[] args) {

    int i=0;

        do{

            i++;

            if(i==2){

                System.out.println("Ending the loop");

                continue;

            }

            System.out.println(i);

            System.out.println("Java is great");


        }while(i<7);

        System.out.println("Loop ends here");

}

}

Post a Comment

0Comments
Post a Comment (0)