An operator is a symbol that operates on a certain data types and produce the output as the result of the operation. Category of Operators • Unary Operator An unary operator is an operator which operates on one operand that is it operates on itself. Operand1 operator Here Operand1 may be a variable , a constant or an expression etc. For example: -b , ~a , x+1 etc. • Binary Operator A binary operator is an operator which operates on two operands. Operand1 operator Operand2 Here Operand1 and Operand2 maybe a variable, a constant or an expression etc. and Operator must be either arithmetic type or relational type or logical type etc. For example: a+b , a && b , etc. • Ternary Operator A ternary operator is an operator which operates on 3 operands. Operand1 o perator Operand2 operator Operand3 Here Operand1 , Operand 2 , Operand3 may be a variable ...
Comments
Post a Comment