Answers for "increment loop java"

15

for loop java

for (int i = 0; i < 5; i++) {
  System.out.println(i);
}
Posted by: Guest on December-10-2019
0

java for increment by 2

int n = 2; //Or any other number

for (int i=0; i < 10; i+=n){
	System.out.println(i) //This will print 0,2,4,6,8
}
Posted by: Guest on June-23-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language