Create a method which prints the sign of an integer n.
|2||The number 2 is positive.|
|-5||The number -5 is negative.|
|0||The number 0 is zero.|
The first step is creating a method and giving it a descriptive name, e.g.
PrintSign. This method will have only one parameter of type
The next step is implementing the logic by which the program will check what the sign of the number is. You can see from the examples that there are three cases - the number is larger than, equal to or lower than zero, which means that we'll make three verifications in our method.
The next step is to read the input number and to invoke the new method from the body of the
Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/594#1.