Social Sciences, asked by manansrivastava13aug, 6 months ago

Write a java program to input number and check it is positive or negative.

Answers

Answered by aaryajoshi41
2

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