What is the use of continue statement ? Explain with an example

Advertisement
Q. What is the use of continue statement ? Explain with an example.
ANS. Continue statement is mostly used inside loops. Whenever it is encountered inside a loop, control directly jumps to the beginning of the loop for next iteration, skipping the execution of statements inside loop’s body for the current iteration.
How this is used inside program?
continue;
Example: continue statement inside for loop
..
for (int j=0; j<=8; j++)
{
    if (j==4)
    {
          continue;
    }

    printf("%d ", j);
}
..
Output:

0 1 2 3 5 6 7 8

Note:- if Solved Assignment will not be downloaded after the payment, checkout your email address there is a email form instamojo and there will be the option of DOWNLOAD FILES please click on that your assignment will be downloaded instantly and please open file in PDF reader.


11AM TO 6PM CALL US +919811854308 Contact us:- ignouassignmentguru@gmail.com
Previous
Next Post »
Thanks for your comment