+ 1
Why is this 11
Var x = 1 For(;x<6;x+=2){ X=x*x } Can somebody please explain why the output is 11? I understand that without the x=x*x part the code output would be 1 3 5 So how does this become 11? Thanks
2 odpowiedzi
+ 3
step 1: x=1, so x*x=1
For the next round add 2, then x=3
step 2: 3*3=9
For the next round add 2, then x=11
step 3: there is no step left, because the if clause ends when x is becomes larger than 6.
The final output will thus be: x=11
😁
+ 1
Could you fix the syntax and also there should be no output