Hi:
As you loop thru your array, do some modulo arithmetic dividing by 3 (the number of elements you want per line):
((cnter++) % 3) == 0)
if that results equals 0 print out the element with a new-line else print the element with no new-line.
Regards,
Ed