how the value decrease in increment operater while in prefix??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how the value decrease in increment operater while in prefix???

16th Apr 2017, 4:29 PM
Muhammad Moin
Muhammad Moin - avatar
4 Answers
+ 5
increment never leads to the decrement, whether it's prefix or suffix, post your script where you got the issue.
16th Apr 2017, 5:16 PM
Nikhil Dhama
Nikhil Dhama - avatar
0
yeah recently i confirmed ittt...thanx for ansawering
16th Apr 2017, 5:18 PM
Muhammad Moin
Muhammad Moin - avatar
0
if the increment operator is in prefix the value is calculated before it is used in any following calculations. for example a = 5; b = ++a * 10; cout << b; would return 60 as the 1 is added on to a (5) before the multiplication
16th Apr 2017, 5:18 PM
Jason Hoffman
Jason Hoffman - avatar
0
oh actually i was not calculating the increment operator
16th Apr 2017, 5:20 PM
Muhammad Moin
Muhammad Moin - avatar