continue Statement

Get introduced to continue statements in C++.

Introduction

Suppose you have a coupon to get five ice-creams free of cost, but the ice-cream man has only three ice-creams. So when you ask for the fourth one, he tells you that he ran out of ice-cream and one of your coupons is wasted. However, after some time, the ice-creams are restocked, and you are able to get your free ice-cream.

In programming, we can use the continue statement for such situations.


The continue statement makes the compiler skip the current iteration and move to the next one.


Use case

...