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]++;
}
Hi, how do i know the output of this code??
i tried using this way, but the results seems dogey..any ideas why??
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;
}
Pls advise me, thank u, is the printf which i have done a incorrect way??