2.7 OPERATORS
An
operator is a symbol that causes the compiler to take action.
In an expression like sum = a + b;
we say that ‘+’ is an operator while ‘a’ and ‘b’ are operands. C also supports certain operators that
are discussed below.
Arithmetic Operators
C provides two unary and five binary arithmetic operators (see
Table 2.2
).
Table 2.2: Showing Arithmetic Operators in C
Symbol
Meaning
+
Unary plus
–
Unary minus
*
Multiplication
/
Division
%
Modulus (remainder operator)
+
Binary Addition
–
Binary Subtraction
In the statement (u*v + w), the multiplication operation is performed first and then addition is
done. This is because * has higher priority than +. In general, multiplication, division, and modulus
operators have higher precedence than the binary addition and subtraction operators.
Do'stlaringiz bilan baham: |