You get a number from the user. If the number is positive, print 'Positive'. If it is negative, print 'Negative'. If it is zero, print 'Zero'.
Conditional statement
Determining whether a number is positive, negative, or zero
Report a typo
Sample Input 1:
5Sample Output 1:
PositiveSample Input 2:
0Sample Output 2:
ZeroWrite a program in Java 17
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int number = scanner.nextInt();
// Your code here
scanner.close();
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.