0
int x=1,m=0; for(;m<10;++m) x=x+x; System.out.print(x);
Explain
2 Answers
+ 1
You can see what's going on in the loop by adding some print works to see how <x> changes with each loop iteration.
int x = 1, m = 0;
for (; m < 10; ++m)
{
System.out.printf("In loop x = %d\n", x);
x = x + x;
}
System.out.printf("Finally ... x is %d", x);
For next time, put snippet in thread Description, and ask for explanation in thread question title. Here's some tips on posting a question đ
https://www.sololearn.com/Discuss/333866/?ref=app
+ 1
it's a loop, explained enough on course too, you can learn here
https://www.sololearn.com/learn/Java/2147/