If I change the 3rd condition to ++i, instead of i++ ...shouldn't it make a difference to the output.? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

If I change the 3rd condition to ++i, instead of i++ ...shouldn't it make a difference to the output.?

but it makes no difference, why??

26th Jul 2018, 12:00 PM
Immanuel Henshaw
Immanuel Henshaw - avatar
5 Answers
+ 10
Immanuel Henshaw can you share your code then it will be easy to understand your problem Thanks
26th Jul 2018, 12:29 PM
Mohammad Amir Aqeel
Mohammad Amir Aqeel - avatar
+ 4
https://www.sololearn.com/Discuss/1271878/?ref=app this is pre increment and post increment.
26th Jul 2018, 12:29 PM
Raj Chhatrala
Raj Chhatrala - avatar
0
yes for more information check language of c book (++× case x will increase first then final value will change just opposite of x++)
27th Jul 2018, 4:37 AM
Sumit kumar
0
I think pre-increment is more efficient
27th Jul 2018, 11:31 AM
Jonathan Nebu
0
they are different cases for one the value is changed and then executed while for the other it is changed after execution
27th Jul 2018, 5:53 PM
shreyansh jain