---
title: 4.7 continue Statement
description: "The `continue` statement skips the remaining statements in the current iteration of the nearest enclosing loop and proceeds with the next iteration. Unlike `break`, it does not terminate the loop. The behavior of `continue` depends on the type of loop…"
url: "https://edcret.in/docs/cpp-programming/decision-making/4-7-continue-statement/"
updated: "2026-09-06"
category: C++ Programming / Decision Making
---

# 4.7 continue Statement

The `continue` statement skips the remaining statements in the current iteration of the nearest enclosing loop and proceeds with the next iteration. Unlike `break`, it does not terminate the loop.

The behavior of `continue` depends on the type of loop in which it is used. In a `for` loop, control proceeds to the loop's iteration expression before the next condition check.

## Source Code

```
#include <iostream>

int main()
{
    for (int number = 1; number <= 5; ++number)
    {
        if (number == 3)
        {
            continue;
        }

        std::cout << number << '\n';
    }

    return 0;
}
```

## Output

```
1
2
4
5
```

## Explanation

- The `continue` statement skips the remaining statements in the current loop iteration.
- The `for` loop generates values from `1` through `5`.
- When `number` becomes `3`, the condition `number == 3` evaluates to `true`.
- `continue` is executed, so the `std::cout` statement is skipped for that iteration.
- Execution then proceeds with the loop's iteration expression, `++number`.
- The loop continues normally with the next value, `4`.
- Unlike `break`, `continue` does not terminate the loop.
- `return 0;` terminates the program successfully.
