I'm not able to understand pre and postfix operators..please help. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I'm not able to understand pre and postfix operators..please help.

https://code.sololearn.com/cu3FyUrdvFVW/?ref=app

1st Jul 2017, 4:55 AM
suryapoojary
suryapoojary - avatar
2 Answers
+ 4
Pre-fix y=++x 1. x=x+1 2. y=x if x=1 then y=2 (first the value of x increased and then the value of x is assigned to y) ------------------------------ Post-fix y=x++ 1. y=x 2. x=x+1 if x=1 then y=1 (first the value of x is assigned to y and then value of x will be increased)
1st Jul 2017, 5:41 AM
Yasiru Nayanajith
Yasiru Nayanajith - avatar