The problem is with your while statement. It always evaluates to 1. If a == 'd', the first inequality is false but the second is true so the result is 1. In any other case, the first inequality is true so the result is 1. Thus the result is always 1. I'm pretty sure that you meant to use &&, not ||.
As a result of this error, when an incorrect letter is input, the if statement evaluates to 0 and you drop down to the else which prints "wrong". And then you reach the bottom of the while without ever changing a. So the process repeats with the old value of a and you get the same result again. And again...