I want to loop through and print each value in the array. I want each int to be separated by commas but I don't want it to end with a comma.

for (int i=k-1; i<n; i=i+k)
...