Comparison operators are: < , > , <= , >= , == , !=

When a conditional statement like if is used to determine whether two values are identical most languages use “==” instead of “=”

if iFirstNumber == iSecondNumber then
print “equal”
print “not equal”

Remember the equal operator “==” very well because you will spend lots of time troubleshooting issues around it. 
The reason is that “=” is used to assign a value and therefore should not be confused with the “==” sign used for comparison. This makes it perfectly clear for computers but often causes trouble for programmers when they attempt to make a comparison using = instead of ==.

!= is just the opposite of == and means “not equal”

! is generally used as an operator “not”
!false == true

Leave a comment

Your email address will not be published.