You mean && not ||.
The variable "yn" is one character. In order for this expression to be evaluated as false, this character must be Y, y, N, and n at the same time, which is impossible.
You need:
while(yn != 'y' && yn != 'Y' && yn != 'n' && yn != 'N')
source share