## WeBWorK Problems

### Re: Reducing square roots using if, ifelse nested within a do loop

by Davide Cervone -
Number of replies: 0
PS, one other issue I forgot to mention is that your termination condition on the do-loop is incorrect. You probably mean $i == 1 rather than $i = 1. The former tests if $i is 1 or not, and the latter assigns the value 1 to $i (and returns the value 1, so is always considered true, so the loop will stop).

But if you use the loop I suggested, that replaces the do loop anyway.