top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Parenthesis are never needed in prefix or postfix expressions. Why?

+3 votes
868 views
Parenthesis are never needed in prefix or postfix expressions. Why?
posted Aug 28, 2015 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

In case of post fix or prefix they follow specific rule which shows the order of operation to be carried out on operand.

In case of post fix : Input : cab++ Expansion c(a+b)+ ---> c+ a+b So here we followed the order where operator is following the operands.
In case of prefix : Input : +c+ab Expansion c + +ab ---> c + a + b So here we followed the where operator precedes the operand.

answer Aug 28, 2015 by Sachidananda Sahu
...