Operators are symbols that act upon data. They represent a particular operation to be performed on the data. operators can be classified in the following categories.
Arithmetical Operators : The arithmetic operator perform arith metic operations on any built in data type.
% Modulus (Remainder)
Special Arithmetic Operator
X ++ or ++ X is equivalent to X = X+1
X -- or -- X is equivalent to X= X-1
Relational Operators: These operator are used to compare two values on the basis of a certain condition.
< Less than
< = Less than equal to
> Greater than
>= Greater than equal to
!= Not equal to
== Equal to
Logical Operator : These operator are used to perform logical operations
& & AND
Assigning Operator : These operator are used assign values to variables.
= Assign Value
+= Add the values and assign it to the left
-= Subtract the values and assign it to the left
*= Multiply the Values and assign it to the left
/= Divide the values and assign it to the left
%= Find the remainder and assign it to the left
Ternary Operator : These operator are very powerful operator in 'C'. In some cases, it is equivalent to the "if" - else statement .
Operator "?" and ":"
Syntax => expression = exp 1 ? exp 2: exp 3;
Example : a= 50; b= a> 100 ? 25:35;
Here the value of b will be 35 because a is less than 100 and the condition is false.