[Solved] how to execute two for loops simultaneously in java without useing multithreading


You can merge 2 for-statements.

for (int i = 1, j = 5; i <= 5; i++, j--) {
    System.out.print(i + " " + j + " ");
}

solved how to execute two for loops simultaneously in java without useing multithreading