Hi, I don’t understand why, when I enter the number 10, the program doesn’t stop:
numb=0;
while(numb!=10){
let numb=Number(prompt("Enter a number: "));
conta=numb+1;
let i=0;
while(i<conta){
console.log(i);
i++;
}}
console.log(“Stop”);
The assignment of the exercise is this:
- Create a program that takes a number as input from the user, and prints all numbers from 0 up to this number (hint: while …).
- Expand the program with a new while loop that requests input from the user for each “round”.
- When the user enters the number 10, the program must end.
Thanks.