Created: 2023-01-11 11:27
Status: #concept
Subject: Programming
Tags: C Expression Comparison Operators
Operator
They are symbols that denote a specific arithmetic, boolean, logical, Function operation to be done on its operands.
They are evaluated in different orders depending on Operator Precedence.
We can ignore precendence by specifying parentheses ()
in our operands to be executed first.
C Operators
See also: sizeof Operator
What is the difference between Unary & Binary operators?
Coming form the Latin term unus or “one”, Unary operators only require ONE operand only.
They are used to denote positivity/negativity of the number after it.
On the other hand, coming from the term bini and meaning “duality”: Binary needs TWO operands to work.
They do the mathematical operations.
// Unary operators
i = +1;
j = -1;
// Binary operators
j = 10 - 3;
k = 12 / 3;
l = 3 * 3;
i = 10 % 3;
References
- C Programming, A Modern Approach, 2nd Edition, Chapter 4.1