If statements and && or ||

后端 未结 12 1352
臣服心动
臣服心动 2020-12-22 02:54

OK so I\'m a beginner with C# and I am having trouble understanding the if statement below.

For this example INumber is declared as 8, dPrice is 0 and dTAX is 10.

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 03:45

    it should only enter the If statement, if iNumber does not equal 8 or 9

    That would be:

    if (!(iNumber == 8 || iNumber == 9))
    ...
    

提交回复
热议问题