from below Snippet, how i value is calculated??
2)Code:1) int i = 2; int k = i++ - i++; printf("%d %d",k i); o/p I m getting ---> k = 0, i = 3 My doubt is ++ operator has R - L evaluation , here am doing post incerement so first expression would be evaluated with original value nd next value will get incremented twice so i value is 4. but am getting i value is 3 ???
Could u plz clarify it....Code:int i = 2; int k = ++i - ++i; printf("%d %d",k,i); o/p i m getting ----> k = -1, i = 4 Here am doing preincrement so first value will get incremented nd next expression will be evaluated .My doubt is 3 - 4 or 4 - 3 ?? first which variable will get incremented??(left side or right side).