C program for continue statement




















This will end the for loop, and the sum is displayed. In C, break is also used with the switch statement. This will be discussed in the next tutorial. The continue statement skips the current iteration of the loop and continues with the next iteration. Its syntax is:. The continue statement is almost always used with the if When the user enters a negative number, the continue statement is executed and it skips the negative number from the calculation.

Course Index Explore Programiz. Popular Tutorials Data Types in C. C for Loop. Arrays in C Programming. By signing up, you agree to our Terms of Use and Privacy Policy.

Forgot Password? This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy. Popular Course in this category. Course Price View Course. Free Software Development Course. Login details for this Free course will be emailed to you. Interview Questions.

Company Questions. Artificial Intelligence. Cloud Computing. Data Science. Angular 7. Machine Learning. Data Structures. Operating System. Computer Network. Improve Article. Save Article. Like Article. Continue is also a loop control statement just like the break statement. As the name suggest the continue statement forces the loop to continue or execute the next iteration. When the continue statement is executed in the loop, the code inside the loop following the continue statement will be skipped and next iteration of the loop will begin.

Syntax : continue; Example : Consider the situation when you need to write a program which prints number from 1 to 10 and but not 6.

It is specified that you have to do this using loop and only one loop is allowed to use.



0コメント

  • 1000 / 1000