Determine if a number is positive, negative or zero

Report a typo

You are given a number N. If N is positive print 'Positive', if N is negative print 'Negative', and if N is zero, print 'Zero'.

Sample Input 1:

5

Sample Output 1:

Positive

Sample Input 2:

-3

Sample Output 2:

Negative
Write a program in Java 17
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
// Create a new Scanner object for reading the input
Scanner scanner = new Scanner(System.in);

// Read the number N
int N = scanner.nextInt();

// Your code goes here

// Important: Remember to close the scanner!
scanner.close();
}
}

Create a free account to access the full topic