If there is an increment operator in an if statement, if (x++>12) { }, will the value of x change in the remaining steps? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If there is an increment operator in an if statement, if (x++>12) { }, will the value of x change in the remaining steps?

The increment value when it is in expression like y = x ++; then the value of x changes.

28th Jul 2017, 6:10 AM
Kalliath Abdul Rasheed Shamil
Kalliath Abdul Rasheed Shamil - avatar
2 Answers
+ 7
The statements in the if condition will be executed. Prefix/postfix operators will follow their own rules and be carried out by the program. https://www.sololearn.com/Discuss/407846/?ref=app
28th Jul 2017, 6:35 AM
Hatsy Rei
Hatsy Rei - avatar
0
x will be increased just try to print x after IF
28th Jul 2017, 6:34 AM
Matte
Matte - avatar