I failed this... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I failed this...

what is the answer for this var sum=o for(i=4; i<8) if(i==6) continue; sum+=i document.write(sum)......

18th Mar 2017, 4:01 PM
Kelvine De Danielo
Kelvine De Danielo - avatar
2 Answers
+ 6
* you write the for loop without the after condition. Assuming the for loops is like this : for(i=4;i<8;i++). The answer is 16. it will executed like this: i=4, then sum = 0+4 = 4 i=5, then sum = 4+5 = 9 i=6, skipped i=7, then sum = 9+7 = 16
18th Mar 2017, 4:11 PM
Dadang NH
Dadang NH - avatar
+ 1
thanks a lot..nw i see a bit clearly
18th Mar 2017, 4:13 PM
Kelvine De Danielo
Kelvine De Danielo - avatar