Sunday, December 6, 2009

2.2 UNARY OPERATORS

C includes a class of operators that act upon a single operand to produce a new value.Such operators are known as unary operator.

Most common unary operator is unary minus,where a numerical constant,variable or expression is preceded by a minus sign.

The increment operator(++) and the decrement operator (--) are other two commonly used unary operators.

e.g ++i -->i=i+1
--i -->i=i-1

No comments:

Post a Comment