ABSTRACT

This chapter discusses the two most essential parts of any programming language: operators and expressions. An operator is a symbol that tells the computer to perform specific mathematical or logical operations. Operators are used in programs to manipulate data and variables. C is very rich in built-in operators. Operators are categorized into eight groups: arithmetic operators, relational operators, assignment operators, logical operators, increment or decrement operators, conditional operators, bitwise operators, and special operators. The chapter includes several small programming examples and explains their usage. A mathematical expression is quite different from a C expression, and a programmer should know how to write these mathematical expressions into its equivalent C code. This chapter covers this along with the precedence and associativity of operators.