increment by two or more.
Hi,
this code increments by one:
for ( i=1; i<=5; i++ ){
System.out.println(i);
}
so it prints like this:(i++), until equals 5.
1
2
3
4
5
But,
What can i do, if I want to increment a for loop by two or more?
Hi,
this code increments by one:
for ( i=1; i<=5; i++ ){
System.out.println(i);
}
so it prints like this:(i++), until equals 5.
1
2
3
4
5
But,
What can i do, if I want to increment a for loop by two or more?