Hello all, I am a struggling C++ student and I am stuck trying to figure out the contents of the array "sample" after the following code is executed:
give declarations:
int sample[8];
int i;
int k;
What are the contents of "sample" after the following code segment is executed:
for (k=0; k<8; k++)
if (k % 2 == 0)
sample[k] = k;
else
sample[k] = k+100;