๐Ÿ’ปap computer science a review

Number % 2 == 0

Written by the Fiveable Content Team โ€ข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโ€ขWritten by the Fiveable Content Team โ€ข Last updated September 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: