Next: Control of Your
Up: Expressions and Operators
Previous: Logical Connectors
Three types of expression have been introduced here;
- Arithmetic expressions are simple, but watch out for subtle type conversions.
The shorthand notation may save you a lot of typing.
- Comparison takes two numbers and produces a logical result.
Comparisons are usually found controlling if statements or loops.
- Logical connectors allow several comparisons to be combined into a single test.
Lazy evaluation can improve the efficiency of the program by reducing the amount of calculation required.
C also provides a set of bit manipulation operators.
These are quite specialised, so interested students would do well to check a textbook for details.