balaji jadav
What happens when you encounter a continue statement inside the for loop?
By balaji jadav in C# on Oct 31 2014
  • Sandeep Miriyala
    Dec, 2014 9

    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

    • 3
  • Vikram Agrawal
    Dec, 2014 8

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

    • 2
  • Srinivas Pabballa
    Aug, 2015 28

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

    • 0
  • Ajay Gandhi
    Aug, 2015 25

    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

    • 0
  • Sreekanth Reddy
    Jul, 2015 11

    skipping the value and continues the loop.

    • 0
  • Rahul Prajapat
    May, 2015 31

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

    • 0
  • Safayat Zisan
    Apr, 2015 17

    The loop does not execute the specific value

    • 0
  • Pankaj  Kumar Choudhary
    Mar, 2015 23

    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.......

    • 0
  • Vikram Agrawal
    Dec, 2014 8

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

    • 0
  • kiran rao
    Nov, 2014 15

    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.

    • 0
  • kiran rao
    Nov, 2014 15

    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.

    • 0
  • santhy chandran
    Nov, 2014 14

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

    • 0
  • Piyush R.
    Nov, 2014 12

    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.

    • 0
  • balaji jadav
    Oct, 2014 31

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

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS