Computer Science, asked by Avirajchettri, 1 year ago

write a program to check whether the integer type number is taken as input positive negative or zero


Avirajchettri: bluej
nitish8089: bluej is not language it's software for developing java code
nitish8089: i am not using bluej for develope java code so if
nitish8089: i would write i don't know it's work on bluej or not

Answers

Answered by nitish8089
7
check out this program:::
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
if(a<0){
System.out.println("negative number");
}
else if(a>0){
System.out.println("positive number");
}
else{
System.out.println("number you enter is zero");

}
}
}
Similar questions