class CountToZeroByTwos {
public static void main (String args[]) {
int i;
for (i=20; i >= 0; i -= 2) {
System.out.println(i);
}
System.out.println("All done!");
}
}
Here's the output.
% javac CountToZeroByTwos.java % java CountToZeroByTwos 20 18 16 14 12 10 8 6 4 2 0 All done! %