Documente Academic
Documente Profesional
Documente Cultură
S.Sakthybaalan
ICT Level V
COT - Jaffna
1
2 8/30/2016
Operator
An operator is a symbol that tells the compiler to perform specific
mathematical or logical manipulations.
Operators
Arithmetic Operators
Assignment Operators
Logical Operators
Bitwise Operators
4 8/30/2016
Logical Operators
AND XOR
OR NOT
5 8/30/2016
operands
5+x
operator
Note:
All expressions have at least one operand.
6 8/30/2016
a b Result (AND)
0 0 0
0 – false
0 1 0
1 0 0 1 - true
1 1 1
else
{
MessageBox.Show "Unauthorised access");
}
8 8/30/2016
OR Operator (||)
The OR operator is similar to AND, as it is used to compare two
Boolean values.
a b Result (OR)
0 – false
0 0 0
}
0 1 1
1 0 1
1 - true
1 1 1
9 8/30/2016
OR Operator in Programming
else
{
MessageBox.Show("Unauthorised access");
}
10 8/30/2016
If the original value is true then the returned value is false; if the
original value is false, the return value is true.
0 – false
a Result (NOT)
0 1 1 - true
1 0
11 8/30/2016
name = "Steven" ;
password = "Steven123" ;
//it returns false because both expression match.