ABSTRACT

C provides a rich set of operators that are used to form expressions and perform operations on them. This chapter presents some of Cs most important operators and shows how to apply them when writing more complex programs. The = operator is used to assign a value to a variable. The arithmetic operators +, -, *, and / are used to perform addition, subtraction, multiplication, and division, respectively. The ++ increment operator is used to increment the value of a variable by 1. The relational operators >, >=, <, <=, !=, and == are used to compare two operands and determine their relationship. The logical operators !, &&, and || are used to form logical expressions. The comma (,) operator can be used to merge several expressions to form a single expression. Bitwise operators are used to access the individual bits of an integer variable or constant. A bit value is either 0 or 1.