DEADMONSTOR wrote:
el une spodermun wrote:
AfroHat wrote:
Okay first of all
for(int i=1; i<=7; i+=2)
for(int J=0; j<=7; j+=2)
System.out.print(" " + i +j);
System.out.println();
This function runs the variables I and J while they are equal or smaller than 7, I starts from 1 and J from 0 each increasment is by 2.
So whats printed is:
" " - a space then I and J while they are lower than 7:
so like this:
1 2
3 4
5 6
7 8
int=0;
while (i < 4)
System.out.println(i);
I wont print cause the function only runs while I is bigger than 1. (for(int i=1; i<=7; i+=2))
Awesome thanks <3
What about
Range (-3,9,-2)
What does it return
I don't think that would even work.
Isn't it start -3 end 9 and interval at -2 so it wouldn't work?
-3 -5 bleh
Would never get there?
It confused me as well, guess the teacher was high or something, but i just found it it was a trick question lmao. Would just have to explain
That Range (Start,Stop,Step) and that it would never get to -9