开发者

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

开发者 https://www.devze.com 2022-12-23 07:15 出处:网络
What does ! mean in pseudo-code? I know ! stan开发者_Go百科ds 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

精彩评论

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

关注公众号