Skip to content

12.9. Challenges: Add challenge of multiple if statements#219

Open
karimdevelops wants to merge 2 commits intoTogether-Java:developfrom
karimdevelops:patch-7
Open

12.9. Challenges: Add challenge of multiple if statements#219
karimdevelops wants to merge 2 commits intoTogether-Java:developfrom
karimdevelops:patch-7

Conversation

@karimdevelops
Copy link
Contributor

A lot of beginners make this common mistake. It's a fun challenge that if statements are always checked even if previous statement is true. However, one might think of this as else if, and that the statement won't be executed.

void main() {
  int num = 10;
  if (num > 1)
    IO.println("It is greater than 1");
  if (num > 5)
    IO.println("It is greater than 5");
}

@karimdevelops karimdevelops requested review from a team as code owners February 15, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant