Can you complete the code to create two loops that count from 1 to 5? The first loop should print the numbers in ascending order, while the second loop prints them in descending order.
Increment and decrement
Ascending dreams, descending schemes
Report a typo
Fill in the gaps with the relevant elements
publc class CounterLoop {
public static void main(String[] args) {
( i ; ; ) {
.(i);
}
for (int i ; ; ) {
System.out.println(i);
}
}
}Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.