Program to input a number and check whether it is positive negative or zero JAVA


Write a Program to input a number and check whether it is positive negative or zero.




import java.util.*;
class number
{
    public static void main(String args[])
    {
         Scanner sc = new Scanner(System.in);
         int n = sc.nextInt();
         if(n < 0)
     
         System.out.println("It is a negative number");
         
         else if(n>0)
         
         System.out.println("It is a positive number");
         
         else
     
         System.out.println("It is a zero");
         
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com