code

Operators in programming are analogous to mathematical operators. Operators take in one or more operands and returns a value. Most programming languages only support unary and binary operators. Others such as C have greater arity operators such as the ternary operator ?:.

Operator overloading

If operators can be defined in a programming language, the programmer may define custom uses for a specific operation. This is called operator overloading.

Only a specific set of operators can be overloaded.

Precedence

Operatos also follow a certain precedence in evaluation. For example, multiplication and division always come before addition and subtraction. Mathematical operations go before relational operators.

Common operators

This lists common operators found in most programming languages and the most common symbol(s) associated with them. Symbols may vary or may not be available depending on the language.

Unary mathematical operators
Binary mathematical operators
Relational and equality operators (binary)
String operators
Logical operators

see also Boolean

Bit shift operators
Incrementing operators

This type of operators may either be prefix (placed before the operand) or postfix (placed after the operand). Prefix operations are evaluated before the main evaluation of the program line, while postfix operations are evaluated after the main evaluation of the program line.

Assignment operators
Type and reference operators
Pointer operators

(low-level languages)

See also