Operator Basics
Operators in C language are symbols which tells the compiler to perform some mathematical calculations or logical operations (we will look at in a while) on the variables and constants. For example, consider the mathematical operation "
10 + 2 - a". Here '+' and '-' are called operators and the values on which operators work ('10', '2', and 'a') are known as operands. C programming language has wide variety of operators which are categorised into different groups based on the type of operations they perform.Operator Arity
Arity implies the number of operands the operator is defined to work on. Based on that we have operators of following articles
| Arity | Description |
|---|---|
| Unary Operator | Operates on single operand. |
| Binary Operator | Operates on two operands, For example: '/' (used for division). |
| Ternary Operator | Operates on three operands. Example : conditional operator (we will discuss about it in this chapter). |
| n-ary Operator | Operators that operate on more than 3 operands. |