Wednesday, November 11, 2009

Operator and its Types

Operator is a symbol that can perform mathematical or logical operation by using operands. eg: +, -, <, >etc.
Types of Operators

*Arithematical Operators (Binary): The operators that can perform simple arithematical calculation such as addition(+), substraction(-), multiplication(*) etc are known as arithematical operator.

*Relational Operator: The operators that are used to compare the expression are called relational operation. less than(<), greater than(>), less than or equal to(<=), not equal to(!=) are some of the examples of relational operator. *Logical Operator: The operators that are used to give logical value either true or false are called logical operator. logical AND(&&), logical NOT(!) are the example of logical operator.

*Unary Operator: The operators that are used to increase or decrease the value by one is called unary operator. ++, -- are the example of this operator

*Assignment Operator: It is used to assign the value of expression into variable. This operator is denoted by =.

*Short Hand Operator: It is the Combination of Arithematic and Assignment operators. At first it perform arithematic operator then assignment operator. example: +=, -=, *= etc.

*Conditional: It is written is the form, exp1?statement1:statement2; where, the value of exp1 is evaluated. If it is true statement1 is executed other statement2 is exicuted.

*Bitwise Operator: It is used to Perform operation in bit level, that is used for logical operations in bit level.

*Comma Operator: This operator is used to join two expression. This operator is denoted by (,)

0 comments: