C – Unary Minus

C – Unary Minus 2017-07-19T18:20:09+00:00

Unary Minus Operator :

The operand of Unary minus operator must have arithmetic type, and the result is the –ve of its operand. The operand can be numerical constant, variable or expression. It is different from arithmetic subtraction operator (requires two operand).

C – UNARY MINUS OPERATOR EXAMPLE PROGRAM :

-(p+q)
x=-y
-10*(p+q)

Output :

The value of a is -100

The value of a is -30

The value of a is 30

 

Prev Next