官术网_书友最值得收藏!

Checking many conditions in an if statement

Sometimes, you will want your if statements to check many conditions before any code block is executed. This is very easy to do. There are two more logical operators that you can use:

  • AND: This is used by putting && between the conditions being checked. The code inside the curly brackets is executed only if all the conditions are true:
  • OR: This is used by putting || between the conditions being checked. Then, the code inside the curly brackets is executed if any of the conditions are true:
主站蜘蛛池模板: 红安县| 马山县| 南和县| 万荣县| 庆云县| 怀柔区| 阳原县| 安化县| 克山县| 黄冈市| 东方市| 关岭| 临西县| 安化县| 浦县| 邵阳市| 会东县| 北辰区| 张家川| 广西| 密云县| 宝清县| 鸡泽县| 古浪县| 五峰| 镇巴县| 涿州市| 汕尾市| 西昌市| 新源县| 株洲县| 绥中县| 溧水县| 安顺市| 那坡县| 潜江市| 南昌县| 家居| 中江县| 洪洞县| 吉水县|