+ 5
/*Please explain the output, output is 12 11 1*/
#include <stdio.h> int main() { int a[5]={5,10,15,20,25}; int i,j,k=1,m; i=++a[1]; j=a[1]++; m=a[i++]; printf ("\n%d %d %d",i,j,m); return 0; }
12 odpowiedzi
+ 2
i = 1, ++1 makes 2, 2 + a[1] equals 12
j = a[1] ++ makes 10 + 1 equals 11
m= a[13] , this is out if bound so the initialen value 1 is printed
Would expert a out of bound exception, do not know why that's is geen as valide.
+ 2
you mean i=[++a1] is not initialization? and i still==0 after that, right?
+ 1
@~ swim ~
I have to admit you are right. Thanks for pointing it out.
+ 1
so I don't get one thing. why is m == 1 in the end if m = a[i++] and i = 11? is it realy random?
+ 1
thank you)