How do I make AND or OR expressions?

user761812 picture user761812 · May 25, 2011 · Viewed 57.1k times · Source

I wrote this:

if( a == -11 && b == -1 ){
{

if( a == -1) AND ( b == -1)...

But neither work, and I have the same problem with OR. How do I write expressions that include OR or AND?

Answer

edc1591 picture edc1591 · May 25, 2011

You use && for “and”, and || for “or”.