if statement not working right?

前端 未结 5 1653
执念已碎
执念已碎 2020-12-02 03:19

I\'ve looked and looked with the debugger and cannot seem to figure out why the IF statement always prints the message.

The IF statement checks to see if yesno != \'

5条回答
  •  旧巷少年郎
    2020-12-02 03:45

    You need to put

    if (yesno != 'Y' || yesno != 'N')

    You always need to put the full expression twice.

提交回复
热议问题