开发者

What does "!" mean in pseudo-code? I know "!" stands for factorial but I can't translate it

What does ! mean in pseudo-code? I know ! stan开发者_Go百科ds for factorial but I can't translate it .

ex:

get operation

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’) then
    print "Invalid Operation"

What does it mean?


!= means not equal and ! generally means not or negation.


It means "not". So your example code

if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’)

can be read as

"If operation does not equal 'B' or operation does not equal 'D' or operation does not equal 'W'"


In general,

!   means   not
|| means logical or
&& means logical and

Example:

!false == true  ( == means equality )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜