Cruz Castillo

Generation

generate functionWed, 24 May 2023

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); } }

Want to kickstart your project?Use the new AI Studio to create your code