0

How to question an exercise

I am new to this. How do I complain/ask for clarification about exercises. In this one var x = 0; while(x<6) { x++; } document.write(x); It says the answer is just 6. Why isn't it 0-6. If it was x+=6; I would understand but it's not and I don't. Martin Nicol

17th Jul 2020, 6:33 AM
Martin Nicol
Martin Nicol - avatar
2 Answers
+ 4
Voleti Varshith , please use appropriate tags (e.g. programming language) for your question. Thanks!
17th Jul 2020, 10:44 AM
Lothar
Lothar - avatar
+ 3
var x = 0; while(x<=6) { x++; document.write(x); } Use the document.write inside the while loop you have used outside the while loop.
17th Jul 2020, 6:37 AM
Varshith
Varshith - avatar