write a program in java to input a number and check whether the number is positive or negative or equivalent to zero.
Answers
Answered by
5
Answer:
Java Program to Check if a Given Integer is Positive or Negative
public class Postive_Negative.
int n;
Scanner s = new Scanner(System.
System. out. print("Enter the number you want to check:");
n = s. nextInt();
if(n > 0)
System. out. println("The given number "+n+" is Positive");
else if(n < 0)
Similar questions
Math,
2 months ago
Math,
2 months ago
Social Sciences,
2 months ago
Computer Science,
4 months ago
Science,
4 months ago