insertCode:int main(){ int a[5]={5,1,15,20,25}; int i,j,m; i=++a[1]; j=a[1]++; m=a[i++]; printf("%d %d %d\n",i,j,m); getch(); return 0; }
its output is coming 3 2 15 but i am not able to understand the reason.anybody clear me on this.
insertCode:int main(){ int a[5]={5,1,15,20,25}; int i,j,m; i=++a[1]; j=a[1]++; m=a[i++]; printf("%d %d %d\n",i,j,m); getch(); return 0; }
its output is coming 3 2 15 but i am not able to understand the reason.anybody clear me on this.
I guess you should go read about variables and increment operators then. What exactly don't you understand? It's pretty straight forward. Make sure you're not confusing yours 1's and i's.
If you understand what you're doing, you're not learning anything.