Page t010, go to
NEXT
,
PREVIOUS
,
INDEX
Arithmetic Operators
List of operators
Purpose
Operator example
add
x + y
subtract
x - y
multiply
x * y
divide
x / y
modulus
x % y
exponentiation
not available in C
unary plus
+x
unary minus
-y
postincrement
x++
preincrement
++x
postdecrement
y--
predecrement
--y
x++
is equivalent to
x = x + 1
x++
means use it, then increment it
++x
means increment it, then use it
no exponentiation; for power of two use
x*x
C Course
, 16-jan-1997,
Peter Klok
,
pfk@hef.kun.nl