Computer Science, asked by sakshi96881439, 9 months ago

difference between prefix and postfix operators​

Answers

Answered by fatima8808
13

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.

Answered by anmolsruchi
10

Answer:

The prefix operator comes before the operand.

The postfix operator comes after the operand.

Similar questions