Computer Science, asked by rajitmaurya563, 19 days ago

Write a program to input a number and check the number is 0,positive, negative.​

Answers

Answered by sachin27114
1

Explanation:

import java. util. Scanner;

public class NumCheck {

public static void main(String[] args) {

Scanner in=new Scanner (System.in);

System.out.print("Enter a no. ");

int n=in.nextInt();

if(n==0)

System.out.println("The number is 0");

else if(n<0)

System.out.println("The number is negative");

else

System.out.println("The number is positive");

}

}

mark as brainliest if it helped u

Similar questions