No, if you enter number less then 1 or greater than 100 the code inside the loop will continue executing as long as this condition is true. It will alert a message "Top number must be greater than zero and less than 100" and will keep you prompting for another input as long as you keep entering numbers less than 1 or greater than 100. On the other hand if you enter number greater then 1 and less than 100 code inside the loop will execute just once and exit. (It wont' return sum, sorry for this, didn't take a look at your code. The sum is calculated later on)
Do while loop is just like the while loop the only difference is that with the do while loop you get sure that your code will get executed at least once regardless of condition specified.
Consider this example:
var blnLoop = true; //specifies boolean for the while loop
while (blnLoop == true)
var n = prompt("Enter a number: ","") //enter some number to stop the loop
blnLoop = false; //if a number was entered stops the loop
With the above code if you want your code inside the while loop to get executed you have to define blnLoop variable. On the other hand take a look at the following code:
do //code will execute at least once
var n = prompt("Enter a number: ","")
while (isNaN(n)) //code inside the loop statement will continue to execute as long as specified condition is true
As you can see the code do the same stuff only with the Do while loop it wasn't necessary to specify blnLoop variable for loop to get executed.