Iterate over the array in C