---
title: 3.15 Bitwise AND
description: "The bitwise AND operator `&` performs an AND operation on each corresponding bit of two integer operands. A bit in the result is `1` only when both corresponding bits are `1`. ``` #include int main() { int a = 12;…"
url: "https://edcret.in/docs/c-programming/operators-and-expressions/3-15-bitwise-and/"
updated: "2026-09-07"
category: C Programming / Operators and Expressions
---

# 3.15 Bitwise AND

The bitwise AND operator `&` performs an AND operation on each corresponding bit of two integer operands. A bit in the result is `1` only when both corresponding bits are `1`.

```
#include <stdio.h>

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

    printf("a & b = %d\n", a & b);

    return 0;
}
```

### Example Output

```
a & b = 8
```

### Explanation

The values are represented in binary as:

```
12 = 1100
10 = 1010
     ----
      1000
```

The `&` operator compares each pair of corresponding bits:

| a | b | a & b |
| --- | --- | --- |
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |

Therefore:

```
a & b
```

produces binary `1000`, which is decimal `8`.

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