C Language Comparison Symbols

Part of the C For Dummies Cheat Sheet

If you’re writing programs in C, you need to use comparison symbols. The symbols C uses, their meanings, and examples are shown in the following table:

Symbol Meaning or Pronunciation “True” Comparison Examples
< Less than 1 < 5
8 < 9
== Equal to 5 == 5
0 == 0
> Greater than 8 > 5
10 > 0
<= Less than or equal to 4 <= 5
8 <= 8
>= Greater than or equal to 9 >= 5
2 >= 2
!= Not equal to 1 != 0
4 != 3.99
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

SERIES
C For Dummies Cheat Sheet

Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.