Forces the integer to be positive or negative respectively.
“The unary + operator does nothing”
int j = 5;
int i = +j; /* does nothing but can be used for style */
int i = -j;/* think (-1) * j, it flips the sign bit *// 0 is undefined. in c89 divsion with a -ve can be
rounded up or down. in c99
division with a -ve is always rounded towards 0.
% 0, and % -n -ve numbersthe modulus operator % only accepts integers. For floats
see fmod. % 0 is undefined. In c89 negative operands depend on
the implementation. In c99
i % j has the same sign as i
Highest: + - (unary) * / % Lowest: + - (binary)
Operators like the binary operators are left associative (implied
grouping is left first then right) i - j - k is equivalent
to (i - j) - k In contrast, unary operators are right
associative- + i is equivalent to - (+)