---
title: 2.6 case Labels
description: "A `case` label defines a value that can be matched against the expression of a `switch` statement. When a match is found, execution continues from that `case` label. ``` #include int main() { int number = 2; switch (number) {…"
url: "https://edcret.in/docs/c-programming/control-flow/2-6-case-labels/"
updated: "2026-09-06"
category: C Programming / Control Flow
---

# 2.6 case Labels

A `case` label defines a value that can be matched against the expression of a `switch` statement. When a match is found, execution continues from that `case` label.

```
#include <stdio.h>

int main()
{
    int number = 2;

    switch (number)
    {
        case 1:
            printf("Onen");
            break;

        case 2:
            printf("Twon");
            break;

        case 3:
            printf("Threen");
            break;
    }

    return 0;
}
```

### Example Output

```
Two
```

### Explanation

The `switch` expression is:

```
switch (number)
```

Since `number` contains `2`, it matches:

```
case 2:
```

Execution begins at that label and the associated statement is executed:

```
printf("Twon");
```

The `break` statement terminates the `switch`.

A `case` label must have a **constant expression** as its value. Two `case` labels within the same `switch` cannot have the same value.

For example:

```
case 1:
case 2:
case 3:
```

defines three distinct case values. The behavior when multiple labels intentionally lead to the same statements is covered by fall-through.
