---
title: "3.10 Logical AND Operator (&&)"
description: "The logical AND operator (`&&`) combines two Boolean expressions and returns `true` only if both expressions evaluate to `true`. If either expression evaluates to `false`, the result of the entire expression is `false`. The logical AND operator is commonly used…"
url: "https://edcret.in/docs/cpp-programming/operators-cplusplus/3-10-logical-and-operator/"
updated: "2026-07-28"
category: C++ Programming / Operators
---

# 3.10 Logical AND Operator (&&)

The logical AND operator (`&&`) combines two Boolean expressions and returns `true` only if both expressions evaluate to `true`. If either expression evaluates to `false`, the result of the entire expression is `false`.

The logical AND operator is commonly used when multiple conditions must be satisfied before a statement is executed.

## Source Code

```
#include <iostream>

int main()
{
    int age = 22;
    bool has_license = true;

    bool can_drive = (age >= 18) && has_license;

    std::cout << "Can drive: " << can_drive << '\n';

    return 0;
}
```

## Output

```
Can drive: 1
```

## Explanation

- The logical AND operator (`&&`) combines two Boolean expressions.
- It returns `true` only when both operands evaluate to `true`.
- If either operand evaluates to `false`, the result is `false`.
- `(age >= 18)` evaluates whether the age requirement is satisfied.
- `has_license` indicates whether the person has a valid driving license.
- The expression `(age >= 18) && has_license` evaluates to `true` only when both conditions are satisfied.
- By default, `std::cout` displays Boolean values as `1` for `true` and `0` for `false`.
- `return 0;` terminates the program successfully.
