Arithmetic Operators

I l @ ve RuBoard

Arithmetic Operators

+ adds the value at its right to the value at its left.

- subtracts the value at its right from the value at its left.

- , as a unary operator, changes the sign of the value at its right.

* multiplies the value at its right by the value at its left.

/ divides the value at its left by the value at its right. Answer is truncated if both operands are integers.

% yields the remainder when the value at its left is divided by the value to its right (integers only).

++ adds 1 to the value of the variable to its right (prefix mode) or adds 1 to the value of the variable to its left (postfix mode).

- is like ++ , but subtracts 1.

I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net