Programming


C Operators

Arithmetic Operators

Operator Purpose
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder after integer division
(modulus)


Unary Operators

Operator Purpose
- Minus (negative number)
++ Increment (increase by 1)
-- Decrement (decrease by 1)
sizeof Size, in bytes
(type) Cast


Relational Operators

Operator Purpose
< Less Than
<= Less Than Or Equal To
> Greater Than
>= Greater Than Or Equal To


Equality Operators

Operator Purpose
== Equal To
!= Not Equal To


Logical Operators

Operator Purpose
&& AND
|| OR
! NOT


Bit-Manipulating Operators

Operator Purpose
& AND
| OR
~ NOT
^ XOR
<< Shift Left
>> Shift Right


Operator Precedence Groups

Operator Category Operators Associativity
unary operators - ++ -- ! sizeof (type) R to L
arithmetic multiply, divide and remainder * / % L to R
arithmetic add and subtract + - L to R
relational operators <  <= >  >= L to R
equality operators == != L to R
logical operators && || L to R
conditional operators ? : R to L
assignment operators = += -= *= /= %= R to L


[  Index  |  Technical Notes Page  ]

This page is for INFORMATIONAL PURPOSES ONLY.

Page author: Dawn Rorvik (rorvikd@evergreen.edu)
Last modified: 12/19/1999