0

Difference between 'and' and 'or'

Does anyone know why 'or' is used for == and 'and' is used for !=? Logically 'or' would mean "either one or the other" which would make more sense if you use it for !=.

30th Jun 2016, 11:23 PM
Leon
Leon - avatar
4 Answers
0
and takes both of the situations whereas or takes only one in account
1st Jul 2016, 6:02 PM
Paras Mehrotra
Paras Mehrotra - avatar
0
oh ok
1st Jul 2016, 6:30 PM
Leon
Leon - avatar
0
I don't understand what you mean by why OR is used for == and AND is used for !=. They don't have to be used in that combination. == checks if both values are equal, != checks if both values are not equal. In no way do they have to be used with the other Boolean operators such as AND or OR specifically. Hope this clears up your confusion.
2nd Jul 2016, 11:16 AM
Gershon Fosu
Gershon Fosu - avatar
0
true and true = true , true and false = false , false and false = false { which means the stuff that and splits must be both true } true or true = true , true or false = true , false or false = false{ which means or needs only one variable to be true } correct me if I'm wrong
3rd Jul 2016, 10:46 AM
Renken Dz
Renken Dz - avatar