Relational Operators in C

Relational Operators in C. Relational operators play a crucial role in the world of programming, facilitating the comparison of values and determining the relationship between them. These operators allow us to create conditions and make decisions based on the logical comparisons of variables. In this article, we will see relational operators available in C language.

Relational Operators in C
Relational Operators in C

Relational Operators in C Table

Equality Operator==
Greater than operator>
Less than operator<
Greater than or equal to operator>=
Less than or equal to operator<=
Inequality operator!=

Equality Operator

The equality operator ‘==’ is used to compare values for equality. It returns true if the values are equal and false otherwise.

Inequality Operator

The Inequality operator ‘!=’ is used to check whether two values are not equal. It returns true if values differ and false if they are equal.

Greter than Operator ‘>’

This operator is used to determine if the value of the left operand is greater than the value of the right operand. It returns true if the condition is met and false otherwise.

Less than Opertaor ‘<‘

This operator is used to determine if the value of the left operand is less than the value of the right operand. It returns true if the condition is met and false otherwise.

Greater than or Equal to Operator ‘>=’

The greater than or equal to the operator is used to check whether the valuer of the left operand is greater than or equal to the value of the right operand.

Less than or Equal to Operator ‘<=’

The less than or equal to the operator is used to check whether the valuer of the left operand is smaller than or equal to the value of the right operand.

Relational operators are fundamental building blocks in C language, allowing us (programmers) to create logical conditions and control the flow of programs.

Happy Learning

See Also

2 thoughts on “Relational Operators in C”

Leave a Comment