Computer Science, asked by sarbaniboae1234, 4 months ago

Wap a program to enter the number and display the positive, Negative and zero ​

Answers

Answered by zaptodonzapgaming
1

Answer:

import java.util.Scanner;

public class Main

{

   public static void main(String[] args)

   {

       int n;

       Scanner s = new Scanner(System.in);

       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)

       {

           System.out.println("The given number "+n+" is Negative");

       }

       else

       {

           System.out.println("The given number "+n+" is neither Positive nor Negative it is zero ");

       }

   }

}

Explanation:

Similar questions