views:

295

answers:

3

What does ! mean in pseudo-code? I know ! stands 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? Please help my mid-term is in hours :S

Thanks in advance for your help :)

+4  A: 

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

Juha Syrjälä
ThnQQ that's been quite helpful :) thnxx so much :)
Dina
+2  A: 

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'"

Will McCutchen
ThnQQQQ :) sooo much :)
Dina
+4  A: 

In general,

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

Example:

!false == true  ( == means equality )
N 1.1
Thank you soooo much thnQ :) hoppe i can help back:)
Dina
Provided the pseudo-code uses C-like syntax.
Joey
@Johannes Rössel: =)
N 1.1
Sorry, it had to be said. I certainly prefer pseudo-code as language-agnostic as possible. It's usually not paradigm-agnostic, though.
Joey
so does this meaning "not" apply to jave or not?
Dina
@Johannes Rössel: agreed.
N 1.1
@Dina : `jave?`
N 1.1
java sorry i meant
Dina
@Dina yes, `!` is the logical not operator in Java.
Mike Daniels
@Dina: yes `!` means `not` in java
N 1.1
Thanks a lot both of u :)
Dina
So, what that pseudo-code half C and half pascal? C doesn't have `OR` but `||`.
The Elite Gentleman
@Gentleman: who said C has `OR` ?
N 1.1