...

Complex Conditions

We can combine multiple conditions using AND (&&) and OR (||) operators for complex logic. To demonstrate, let's look at qualifying criteria for an imaginary gaming tournament:

A player qualifies for our gaming tournament if they meet at least one of the following criteria:

  • Young prodigy: The player's age is less than 16 and level is greater than 30 (age < 16 && level > 30)
  • High achiever: The player's level is greater than 50 (level > 50)

We can combine these two criteria into a single condition using the OR (||) operator: criteria 1 OR criteria 2.

Your Task

Complete the attached code sample by combining the two conditions using the OR operator.

Loading...

Output (Console)