Sign of a Number

Operators ยท easy

Implement `sign(n)` returning `-1`, `0`, or `1` for negative, zero, and positive numbers using a ternary expression.

Loading...

Run your code to see results.