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

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:
主站蜘蛛池模板: 香河县| 盐源县| 孝感市| 大埔县| 湘潭县| 抚州市| 射洪县| 荆门市| 隆林| 临颍县| 邻水| 宜丰县| 温宿县| 和林格尔县| 宁河县| 瑞金市| 宜良县| 五原县| 栾川县| 马山县| 正安县| 宁海县| 雷州市| 延川县| 和顺县| 荥阳市| 新邵县| 三门县| 凤阳县| 宜春市| 武义县| 讷河市| 乐平市| 临澧县| 云安县| 霍山县| 公安县| 芜湖县| 图们市| 高雄市| 鲁甸县|