how does post and pre increment, decrements work on negative numbers? And what will be the result of the following program, why?



10/9/2019 1:54:40 PM

King Vasishta

2 Answers

New Answer


The result of the program is undefined by Standards, irrespective of whether the initial value was negative or positive because the expression suffers from an issue called "sequence point" which happens when the variable is accessed and modified more than once in an expression. Whatever result you get is compiler specific. Search net for more information on "sequence point".


once you go through stack implementation ........!!! you will get a clear idea about the output of your code .