14
Reply

What happens when you encounter a continue statement inside the for loop?

balaji jadav

balaji jadav

Oct 31, 2014
3.7k
0

    Dear If you use continue in for loop it will skip the that value , If you use break it will not give any output for that ...for(var i=0;i<=10;i++) { if(i==5) continue; if(i==6) break; console.writeline(i); }//For Continue output : 1234678910 //For break output : 1234

    Sandeep Miriyala
    December 09, 2014
    2

    It will skip all the statements after the continue statement and go for the next iteration.

    Vikram Agrawal
    December 08, 2014
    2

    it will skip the execution of the current statements and moves to the loop for next iteration

    Srinivas Pabballa
    August 28, 2015
    0

    From the continue statement all the lines of code won't get executed for that specific iteration. Loop continuing to next iteration.for(i=1;i<=10;i++) { //My All lines of code executes for all iteration if(i==5) continue; //Below line of code wont executed when i==5 print(i); }for more details https://msdn.microsoft.com/en-us/library/923ahwt1.aspx

    Ajay Gandhi
    August 25, 2015
    0

    skipping the value and continues the loop.

    Srikanth Reddy
    July 11, 2015
    0

    It will skip all the statements after the continue statement and go for the next iteration.

    Rahul Prajapat
    May 31, 2015
    0

    The loop does not execute the specific value

    Safayat Zisan
    April 17, 2015
    0

    If you use the continue statement in any loop then it will skip the implementation of remaining step and execution of program jump to the starting of loop.......

    for(i=1;i<=10;i++) { if(i==5)continue; print(i); }O/P 1234678910

    Vikram Agrawal
    December 08, 2014
    0

    it will skip one number and continue form another number... for example: in for loop we are printing 1 to 10 numbers and in that case if we are printing 5 number the we written in if statement that (if I==5) then we write continue statement, then in output it will print 1 to 4 and it will skip 5 and then continue to print 6 to 10.

    kiran rao
    November 15, 2014
    0

    it will skip one number and continue form another number... for example: in for loop we are printing 1 to 10 numbers and in that case if we are printing 5 number the we written in if statement that (if I==5) then we write continue statement, then in output it will print 1 to 4 and it will skip 5 and then continue to print 6 to 10.

    kiran rao
    November 15, 2014
    0

    It skips the rest of the current iteration and start the next iteration execution.

    santhy chandran
    November 14, 2014
    0

    Basically 'Continue' is a branching statement means when is found in a code,compiler understand to continue the same thing that's why the rest part of code is not executed and loop continuous works until condition satisfied.

    Piyush R.
    November 12, 2014
    0

    The code for the rest of the loop is ignored, the control is transferred back to the beginning of the loop.

    balaji jadav
    October 31, 2014
    0