Computer Science, asked by debonitachowhan24, 4 months ago

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 umangbatra09
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