Hi,

Where have you assigned the value to "realanswer"?

Here is a tweaked code of the same....!
You can use the "while" loop to make it much better in case of "for".