The continue statement is used to skip the rest of the loop body and move on to the next iteration. When encountered inside a loop, the continue statement immediately jumps to the loop's update expression or the loop condition, bypassing any remaining statements within the loop body.
Example:
for (int i = 0; i < 5; i++) {
if (i == 2) {
continue; // Skip the current iteration when i equals 2
}
cout << i << " ";
}
// Output: 0 1 3 4