if(expression) {
statement; statement;
}
This helps the control and flow of the programs, used to check if condition has been reached, the computer determines whether the expression (in the brackets) is true or false. If true the statements (inside the curly brackets) are executed, if not, the program skips over the code.
To test for equality is ==
A warning: Beware of using = instead of ==, such as writing accidentally
if ( i = j ) .....
This is a perfectly LEGAL C statement (syntactically speaking) which copies the value in "j" into "i", and delivers this value, which will then be interpreted as TRUE if j is non-zero. This is called assignment by value -- a key feature of C.
!= (not equals)
< (less than) > (grater than)
<= (less than or equals)
>= (greater than or equals)