en.javascript.info/1-js/02-first-steps/10-ifelse/3-sign/task.md
Ilya Kantor 9ad9063d00 up
2016-11-28 21:35:42 +03:00

304 B

importance: 2


Show the sign

Using if..else, write the code which gets a number via prompt and then shows in alert:

  • 1, if the value is greater than zero,
  • -1, if less than zero,
  • 0, if equals zero.

In this task we assume that the input is always a number.

[demo src="if_sign"]