The Number Neutralizer

EasyAcc. 98.8%
+15 XP 5

Zero: The Middle Ground

When dealing with ranges, "Zero" is often a unique edge case. By sequencing your if-else if ladder correctly, you can split reality into three distinct zones.

The Assignment

Your function receives a parameter named value.

  1. Write an if-else if ladder:
    • If value is greater than 0, print: "Positive"
    • If value is less than 0, print: "Negative"
    • Otherwise (the neutral zone), print: "Zero"

01EXAMPLE 1

Inputvalue = -5
OutputLogs: "Negative"

Explanation: Value is less than 0.

02EXAMPLE 2

Inputvalue = 0
OutputLogs: "Zero"

Explanation: Value is neither > 0 nor < 0.

Constraints

  • Use an if-else if-else structure.
  • Log messages must match exactly.
Control FlowConditionalsMath
JavaScript
Loading...
4 Hidden

Input Arguments

value-5

Expected Output

Negative

Click RUN to test your solution