0
if minus is used in unary operand so how ot can used as binary operand?
programming inc++
4 Respuestas
0
Depends on the operand associated.
Unary operator means it contains Or applied to only one operand. Binary means it have both operands left and right side.
Ex:
for minus:
x=5
then unary minus applying
x= - x
Now x = - 5.
For binary : x = x - x;
Now x = 0.
From your previous question, I forgot reply, sry you may continue there if any doubt, if.
What I mean there is :
If x = 5
Then x = +5 means, no effect x still 5.
Even for y = - 5 then y = +y has no effect.
But x= - 5 or x = -x will apply minus to operands hence value changed to negative value.
y = - 5
y = - y
Now y =5 (positive value)
So unary + has no effect, not needed..
0
thanks but can you please explain little bit more
0
Bit more where..? Pls specify where you can't understanding...
It may easy to explain it in your words..
0
i don't understand that if minus is used as unary operand so why and how it can be used as binary operand ?can you explain it in easy way