difference between prefix and postfix operators
Answers
Answer:
(Prefix Operator)
The increment operator ++ if used as prefix on a variable, the value of variable gets incremented by 1. After that the value is returned unlike Postfix operator. It is called Prefix increment operator. In the same way the prefix decrement operator works but it decrements by 1.
For example, an example of prefix
(Postfix Operator)
The increment operator ++ if used as postfix on a variable, the value of variable is first returned and then gets incremented by 1. It is called Postfix increment operator. In the same way the decrement operator works but it decrements by 1.
An example of Postfix operator.
Answer:
The prefix operator comes before the operand.
The postfix operator comes after the operand.