Logo

Programming-Idioms

History of Idiom 256 > diff from v26 to v27

Edit summary for version 27 by programming-idioms.org:
[Java] int is signed

Version 26

2022-01-27, 18:55:35

Version 27

2022-01-27, 22:31:24

Idiom #256 Count backwards

Print the numbers 5, 4, ..., 0 (included), one line per number.

Idiom #256 Count backwards

Print the numbers 5, 4, ..., 0 (included), one line per number.

Extra Keywords
countdown negative step reverse
Extra Keywords
countdown negative step reverse
Code
for(int i=5;i>=0;i--){
    System.out.println(i);
    }
Code
for(int i=5 ; i>=0 ; i--) {
    System.out.println(i);
}
Comments bubble
Note that the int type is signed