Cruz Castillo

Generation

generate functionThu, 25 May 2023

Program to print the serie 1, 99, 2, 98, 3, 97, 4, 96, 5, 95 separated by commas except the final value with while in java.

public static void main(String[] args) { int i = 1; int j = 99; while (j > 0) { System.out.print(i + " " + j); if (j > 1) { System.out.print(", "); } i++; j--; } }

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