Home » C Programming » Relational Operators in C Programming

Relational Operators in C Programming

C Language has a following relational operators. For example: Assume variable A holds 100 and variable B holds 200 then −

Operator Description Example
== Equals to (A == B) is not true.
!= Not equal (A != B) is true.
Greater than (A > B) is not true.
Less than (A < B) is true.
>= Greater than or equals to (A >= B) is not true.
<= Less than or equals to (A <= B) is true.
Example: Write a C Program to find the largest of two numbers.

Output

Please follow and like us:
error