Determine the type of the input number

Report a typo

You are given a number as the input. Your task is to determine whether it is a positive integer, negative integer, zero or a non-integer. If the integer is positive, print 'positive'. If it is negative, print 'negative'. If the integer is zero, print 'zero'. If it is a non-integer, print 'non-integer'.

Sample Input 1:

5

Sample Output 1:

positive

Sample Input 2:

-20

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 Scanner object
Scanner sc = new Scanner(System.in);

// Place your code here


sc.close();
}
}

Create a free account to access the full topic