➽ Program:-
import
java.util.*;
import
java.io.*;
public
class Main
{
public static void main(String args[])
{
int number;
Scanner s = new Scanner(System.in);
number = s.nextInt();
System.out.print("Enter a Number:
");
if(number >= 0)
{
System.out.print(number + " is
a Positive number");
}
else
{
System.out.print(number + " is
a Negative number");
}
}
}
➽ Output:-
Enter a Number: 22
22 is a Positive number
Enter a Number: -4
-4 is a Negative number
0 Comments
Please do not enter any spam link in the comment section.