Difference between x++ and ++x (in computer)
Class 10th icse board
Answers
Answered by
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
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
English,
6 months ago
History,
6 months ago
Accountancy,
6 months ago
English,
1 year ago
Political Science,
1 year ago
Chemistry,
1 year ago