# Iterative Statements

Iterative statements let you repeat a statement until a specified expression becomes false, or a **`return`** within the statement body is executed.

## While Statement

### Syntax <a href="#syntax" id="syntax"></a>

_`iteration-statement`_:\
 **`while (`**_`expression`_**`)`** [_`statement`_]()

### Example

<pre class="language-c"><code class="lang-c"><strong>int a = 0;
</strong>while (a != 2) {
    a++;
}
</code></pre>

&#x20;In this example, `a` is increased by 1 until it is equal to 2.

## For Statement

The body of a **`for`** statement is executed zero or more times until an optional condition becomes false. You can use optional expressions within the **`for`** statement to initialize and change values during the **`for`** statement's execution.

### Syntax

_`iteration-statement`_:\
 **`for`** **`(`** _`init-expression`_&#x6F;pt **`;`** _`cond-expression`_&#x6F;pt **`;`** _`loop-expression`_&#x6F;pt **`)`** [_`statement`_]()

### Example

```c
for (int i = 4; i > 0; i--) {
}
```

&#x20;In this example, i is decreased by 1 until it is equal to zero.
