Hi i am ujwala i have a confusion regarding inc and dec operators(pre and post).i mean how r they evaluated if they are given in a statemnt.
here i calculated in this way plz clear me if i am wrongCode:#include<stdio.h> #include<conio.h> void main() { int i=0; int k; clrscr(); k=(i++)-(i++)-(--i)-(++i); printf("%d\n",i); printf("%d\n",k); getch(); }
now i value is evaluated from left to right
here i got i=2,k=0 which is same as in o/p window
but for this k=(i++)+(i++)+(--i)+(++i);
i got k=2,i=2 but here teh o/p window shows i=2,k=0 how??i dnt understand