Computer Science, asked by Anonymous, 1 year ago

Difference between x++ and ++x (in computer)
Class 10th icse board

Answers

Answered by tejasgupta
2
Hi. They both are incrementing the value of x. The only difference is that x++ uses the value of x first and then increments while ++x increments the value of x first and then uses it. Hope it helps!
Answered by Anonymous
2

x ++ is known as postfix .

it increases the value of x after the operation is over.

++ x is known as prefix .

It increases the value of x before the next operation .

For example :

a++ + a [ a = 5 ]

= 5 + 6

= 11

++ a + a [ a = 5 ]

= 6 + 6

= 12

Hope you get it __/\___

Similar questions