if minus is used in unary operand so how ot can used as binary operand? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

if minus is used in unary operand so how ot can used as binary operand?

programming inc++

17th Jul 2020, 2:38 PM
Maviya
4 Answers
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..
17th Jul 2020, 2:52 PM
Jayakrishna 🇮🇳
0
thanks but can you please explain little bit more
17th Jul 2020, 2:56 PM
Maviya
0
Bit more where..? Pls specify where you can't understanding... It may easy to explain it in your words..
17th Jul 2020, 3:02 PM
Jayakrishna 🇮🇳
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
17th Jul 2020, 3:06 PM
Maviya