> ## 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 OR

The `||` (logical OR) operator is a binary operator that performs a boolean inclusive disjunction on two scalar operands. It evaluates to `1` (of type `int`) if at least one of its operands compares unequal to `0`, and evaluates to `0` if both operands compare equal to `0`.

```c theme={"dark"}
logical-OR-expression:
    logical-AND-expression
    logical-OR-expression || logical-AND-expression
```

## Operand Requirements

Both operands must be of scalar types, which include arithmetic types (integer and floating-point) and pointer types. The operands are not required to be of the same type. During evaluation, each operand is implicitly compared against `0` (or a null pointer).

## Evaluation Mechanics and Short-Circuiting

The `||` operator enforces strict left-to-right evaluation and implements **short-circuit evaluation**.

1. The left operand is evaluated first.
2. If the left operand evaluates to a non-zero value (true), the overall expression is guaranteed to be true. Consequently, the right operand is **not evaluated**.
3. The right operand is evaluated if and only if the left operand evaluates to `0` (false).

```c theme={"dark"}
// Syntax visualization of short-circuiting
(expr1) || (expr2)
```

*If `expr1` != 0, `expr2` is completely ignored, including any function calls or side effects within it.*

## Sequence Points

A sequence point exists immediately after the evaluation of the first operand. All side effects of the first operand (such as post-incrementing or memory writes) are guaranteed to be complete before the second operand is evaluated (if it is evaluated at all).

## Result Type

Regardless of the types of the operands provided, the result of the `||` operator is always of type `int`. The resulting value is strictly normalized to either `1` or `0`.

## Precedence and Associativity

* **Precedence:** The `||` operator has lower precedence than the logical AND operator (`&&`) and higher precedence than the conditional operator (`?:`) and all assignment operators.
* **Associativity:** It groups left-to-right. An expression like `a || b || c` is parsed as `(a || b) || c`.

<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>
