Operators &&(AND), ||(OR), !(NOT)

var x = 11
if x>10 && x<20 {
print("between")
}
else{
print("not in range")
}

var y:Int = 9

if y>10 || y<20 {
print("in range")
}else{
print("not in range")
}

if (y != 20) {
print("not equal")
}else{
print("equal")
}
Previous
Next Post »