Your loop keeps doing the same calculation over and over again. It never uses the result from the previous iteration (answer) in the next iteration. In other words answer is always on the left hand...