0
Can someone explain this question to me? Please
int i = 5; while (i<=15){ if ((i++)%3==0){ System.out.println(i); } } }
3 Respostas
+ 3
that code should return an error since there's a { too much, but otherwise,
that code counts from 5 till 15 (15 included) and prints every number in that range which is divisable by 3.
so the output is:
6
9
12
15
rewriting the code more readable would be:
for(int i=5;i<=15;i++){
if(i % 3 == 0){
System.out.println(i);
}
}
0
u need to remove "}" in end
0
Thanks all...