Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The symbols that give instructions to perform different types of mathematical and logical
operations are called operators. We can define operators as the tools which can alter the values
of data and variables. The important operators used in C language are:
Arithmetic operators
Logical operators
Relational operators
Assignment operators
Conditional operators
Increment or decrement operators
Bit wise operators
Special operators
Arithmetic operators
Arithmetic operators are commonly used operator in programming languages. C programming
language consists of Binary arithmetic and Unary arithmetic. The data, which is operated by
the operator, is called operand. In Unary operation there will be only one operand (eg: -1
Negative number). To perform a binary arithmetic, we need at least 2 operands. Different
arithmetic operators are given below:
Logical operators
Logical operators are also called Boolean operators. These operators are used to check two or
more conditions. Boolean operators are followed:
Relational operators
Operators used to compare two values according to their relation are called Relational
operators. These are also called Comparison operators. For performing relational operation we
must need two operands, then only we can illustrate and check the relation between them. 6
relational operators are:
Assignment operators
Assignment operators are used to assign a value to a variable. ‘=’ is used as assignment operator.
For example i=10;
Conditional operators
These operators work according to some condition. The syntax is given by
i=expression1? Expression2:expression3
Eg: i=a>b?a:b;
The meaning of above statement is if a>b, then i=a, else i=b