💻ap computer science a review

Number % 2 == 0

Written by the Fiveable Content Team • Last updated August 2025
Verified for the 2026 exam
Verified for the 2026 examWritten by the Fiveable Content Team • Last updated August 2025

Definition

The expression "number % 2 == 0" checks if a number is divisible by 2 without having any remainder. If there is no remainder (i.e., equal to zero), it evaluates to true; otherwise, it evaluates to false.

"Number % 2 == 0" also found in:

2,589 studying →