Computer Science, asked by jhonvivas1674, 1 year ago

Express the OR operator in terms of AND and NOT operator.

Answers

Answered by mersalkeerthi46
0

This question already has an answer here:

What is the difference between the | and || or operators? 13 answers

Difference between eager operation and short-circuit operation? (| versu || and & versu &&) 7 answers

A co-worker and I had a discussion about what style is used to express the AND NOT condition in C#. While both methods work, we disagree about the style of the operator.

He says that && ! is the preferred way. For example:

db.Widget.Where(w => w.Name == "Foo" && !w.IsBlue);

I say that that will work, but &! will work. For example:

db.Widget.Where(w => w.Name == "Foo" &! w.IsBlue);

Similar questions