Answers for "for with two values java"

2

for with two values java

public class forloop {
    public static void main(String[] args) {
        // for loop with two variable i & j
        // i will start with 0 and keep on incrementing till 10
        // j will start with 10 and keep on decrementing till 0
        for (int i = 0, j = 10; i < 10 && j > 0; i++, j--) {
            System.out.println("i = " + i + " :: " + "j = " + j);
        }
    }
}
Posted by: Guest on April-07-2021

Code answers related to "for with two values java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language