Program to print the serie 1, 99, 2, 98, 3, 97, 4, 96, 5, 95 with horizontal printing separated with a comma each number of the series.
private static void printSeries(int n) { for (int i = 1, j = n; i <= n && j > 0; i++, j--) { System.out.print(i + "," + j); } }