Contact: aviboots(AT)netvision.net.il
41,465 questions
54,012 answers
573 users
public class Example { public static void main(String[] args) { for (int i = 1; i <= 10; i++) { System.out.println(i); } } } /* run: 1 2 3 4 5 6 7 8 9 10 */
public class Example { public static void main(String[] args) { for (int i = 10; i > 0; i--) { System.out.println(i); } } } /* run: 10 9 8 7 6 5 4 3 2 1 */
public class Example { public static void main(String[] args) { for (int i = 0, j = 10; i < 10; i++, j--) { System.out.println(i + " " + j); } } } /* run: 0 10 1 9 2 8 3 7 4 6 5 5 6 4 7 3 8 2 9 1 */