> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# C Logical NOT

The `!` (logical NOT) operator is a unary operator that performs logical negation. It yields an `int` value of `1` if its operand compares equal to zero, and `0` if its operand compares unequal to zero.

**Syntax**

```c theme={"dark"}
!operand
```

**Operand Constraints**
The operand must be of a scalar type. In C, scalar types include:

* Arithmetic types (integer and floating-point types)
* Pointer types

**Evaluation and Type Semantics**
Regardless of the operand's original data type, the result of the `!` operator is strictly of type `int`.

The evaluation follows these rules:

* If `operand == 0` (or `NULL` for pointers), `!operand` evaluates to `1`.
* If `operand != 0` (or non-`NULL` for pointers), `!operand` evaluates to `0`.

Semantically, the expression `!E` is exactly equivalent to `(0 == E)`.

**Precedence and Associativity**
The `!` operator belongs to the unary operators group (Precedence Level 2 in C).

* **Associativity:** Right-to-left.
* **Precedence:** It binds more tightly than binary arithmetic, relational, equality, and binary logical operators.

Because of its high precedence, an expression like `!a == b` is parsed as `(!a) == b`. To negate the result of an equality check, explicit grouping parentheses are required: `!(a == b)`.

**Double Negation (`!!`)**
Because `!` forces any non-zero value to `0` and any zero value to `1`, applying the operator twice sequentially evaluates to a normalized integer boolean representation of the original scalar:

```c theme={"dark"}
!!operand
```

* If `operand` is `0`, `!!operand` evaluates to `0`.
* If `operand` is any non-zero value (e.g., `42`, `-3.14`, or a valid memory address), `!!operand` evaluates to `1`.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor C Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
