Hi. I am trying to understand this output. It outputs mostly as I would expect, except for the 89. I was expecting a 2 there. And, I must admit, I have no idea how this 89 came about. Any tips?Code:#include <stdio.h> int main (void) { int i, ar [100]; printf ("\n\n\n"); for (i = 0;i < 100;i = i + 1) { ar[i] = 1; ar[11] = -5; ar[12] = ar[12] + 1; ar[13] = ar[0] + ar[11] + 4; } for (i = 10; i <= 14; i = i + 1) { printf ("ar[%2d] = %4d\n", i, ar[i]); } return 0; }
1
-5
89
0
1
I get all but the 89. I was expecting a 2 there. What am I missing?
Thanks your your help.
Have a nice weekend,
Jalisco



LinkBack URL
About LinkBacks



