---
title: 3.16 Bitwise OR
description: "The bitwise OR operator `|` performs an OR operation on each corresponding bit of two integer operands. A bit in the result is `1` when at least one of the corresponding bits is `1`. ``` #include int main() { int…"
url: "https://edcret.in/docs/c-programming/operators-and-expressions/3-16-bitwise-or/"
updated: "2026-09-07"
category: C Programming / Operators and Expressions
---

# 3.16 Bitwise OR

The bitwise OR operator `|` performs an OR operation on each corresponding bit of two integer operands. A bit in the result is `1` when at least one of the corresponding bits is `1`.

```
#include <stdio.h>

int main()
{
    int a = 12;
    int b = 10;

    printf("a | b = %dn", a | b);

    return 0;
}
```

### Example Output

```
a | b = 14
```

### Explanation

The values are represented in binary as:

```
12 = 1100
10 = 1010
     ----
     1110
```

Each pair of corresponding bits is compared:

| a | b | a | b |
| --- | --- | --- |
| `0` | `0` | `0` |
| `0` | `1` | `1` |
| `1` | `0` | `1` |
| `1` | `1` | `1` |

Therefore, `1100 | 1010` produces `1110`, which is decimal `14`.

The bitwise OR operator operates on the individual bits of integer operands.
