16


Conditionals

This Chapter deals with the various methods that C can control the flow of logic in a program. Apart from slight syntactic variation they are similar to other languages.

As we have seen following logical operations exist in C:

==, !=, ||, &&.

One other operator is the unitary - it takes only one argument - not !.

Let's recall what they mean:

== equal,

!= not equal

|| or, a||b is only false if both a and b are false

&& and, a&&b is only true if both a and b are true

! not, !a is true if a is false, and is false if a is true

These operators are used in conjunction with the following statements.



drago@scri.fsu.edu
Jan. 1997