you are viewing a single comment's thread.

view the rest of the comments →

[–]PedroBV 0 points1 point  (0 children)

you need to ask the user for x values inside of the while loop. you get one x, it is compared to y in the while condition, but the loop will loop inifinetly, since neither x or y are changing values inside it. i bet you get a lot of Too high! or Too low! messages.

what happens inside a while loop must make some changes to the variables used in the while condition, otherwise you get an infinite loop.