Learn
Exam

Determine the Sign

Difficulty
STARTER

Problem

Given an integer number, write a function solution that determines the sign of the integer.


Constraints

  • number is an integer between -100 and 100 inclusive.
  • If number is positive, return the string "POSITIVE"; if number is negative, return the string "NEGATIVE"; if number is 0, return the string "ZERO".

Test Case

Test Case Number number return
1 10 "POSITIVE"
2 0 "ZERO"
3 -5 "NEGATIVE"

Explanation for Test Case 1

  • When number = 10, it is positive, so return "POSITIVE".

Explanation for Test Case 2

  • When number = 0, it is zero, so return "ZERO".

Explanation for Test Case 3

  • When number = -5, it is negative, so return "NEGATIVE".