Hi, how do i know the output of this code??Code:#define N_ELEMS 5 int main(void) { int array[N_ELEMS]; int i; for(i=0;i<N_ELEMS;i++) array[i]=i; for(i=0;i<N_ELEMS-1;) array[++i]++; }
i tried using this way, but the results seems dogey..any ideas why??
Pls advise me, thank u, is the printf which i have done a incorrect way??Code:#define N_ELEMS 5 #include <stdio.h> int main(void) { int array[N_ELEMS]; int i; for(i=0;i<N_ELEMS;i++) { array[i]=i; } printf("%i\n",array); for(i=0;i<N_ELEMS-1;) { array[++i]++; } printf("%i\n",array); return 0; }



LinkBack URL
About LinkBacks


