Skip to content
Advertisement

How to execute the “if” and “else” at the same time?

Interesting problem:

Change if statement and print out “Hello World”

JavaScript

My solution is to add “!System.out.println(“Hello”)” in the if statement,But it doesn’t work, any ideas?

JavaScript

UPDATE: I think this works:

JavaScript

In C:

JavaScript

Advertisement

Answer

Tadaaaa:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement