PPA-1
Question
Accept an integer as input. Print positive
if it is greater than zero and negative
if it is less than zero. You can assume that the input will be non-zero.
Hint
An incomplete outline of the solution is given below:
Can you complete it?
Solution
Since the problem statement assures us that the input will be non-zero, the following solution will work.
If the input could be zero, then we need to modify the code as follows:
This snippet will not print anything when \(0\) is passed as input.