x = 1;for(;x = <6; x+=2){ ×=×*×;} alert(×) The answer is 11, how? Edited i changed to x | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

x = 1;for(;x = <6; x+=2){ ×=×*×;} alert(×) The answer is 11, how? Edited i changed to x

There no math and digit which multiplies by itself and caused 11 excluding float.

7th Jul 2019, 8:11 AM
Jelena🇷🇺
Jelena🇷🇺 - avatar
5 Answers
+ 10
https://code.sololearn.com/WDHGc64OlHJ9/?ref=app I think this is your question x=1 x<=6 true x=x*x=1 x=1+2=3 x<=6 true x=3*3=9 x=9+2=11 x<=6 false
7th Jul 2019, 8:21 AM
Rstar
Rstar - avatar
+ 4
I don't believe you shared the exact code. It contains errors, and multiplying 1 by 1 will always be one. I have seen another challenge that I think you are thinking about: let i = 1; for (; i <= 6; i++) { i = i * i; } alert(i); Let's run through it: i = 1 i = i * i //1 i += 2 //3 i = i * i //9 i += 2 //11 At this point, it stops the loop, since the condition is false
7th Jul 2019, 8:19 AM
Airree
Airree - avatar
+ 1
the answer is "16"
8th Jul 2019, 10:14 AM
majdi salim
- 2
how old a you jelena/helena?
7th Jul 2019, 11:04 AM
Alex
Alex - avatar
- 2
Мне двадцать лет! Это класс!
7th Jul 2019, 11:06 AM
Alex
Alex - avatar