Chapter 3 Operators and Expressions
Outline
Arithmetic Operators
Relational Operators
Logic Operators
Bitwise Operators
Assignment Operators
Increment and Decrement Operators
Conditional Operator
Cast Operators
Comma Operator
Sizeof Operator
Precedence and Associativity of Operators

This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
Arithmetic Operators
•
There are five arithmetic operators:
1) +
Addition
2) -
Subtraction
3) *
Multiplication
4) /
Division
5) %
Modulus
•
The multiplication operator * is needed for multiplication.
•
The result of the % operator is the remainder. If the value of
the
second operand is zero, the behavior is undefined.
•
The operands of the % operator shall have integer type.
Example:
> int i = 5
> 5*i
50
> 19/5
3
> 19%5
4
> 19.0/5
3.8000
> 19/5.0
3.8000