Overview
Comparison operators (also called relational operators) are used to compare two values. They always return a boolean value:true or false.
Comparison Operators Table
Basic Example
Here’s a complete example demonstrating all comparison operators:Comparison operators are essential for control flow statements like
if, while, and for loops.Understanding Equality
Equal (==) vs Not Equal (!=)
Range Comparisons
Greater Than and Less Than
Inclusive Comparisons
The>= and <= operators include the boundary value: