Thursday, June 4, 2020

Write a program in java to input a number and check whether it is Positive or Negative or Neutral?

4)  Write a program in java to input a number and check whether it is Positive or Negative or Neutral?

public class positive_negative_neutral
{
   public static void main(int a)
   {
       if(a>0)
       {
           System.out.println("positive");
       }
       else if(a<0)
       {
           System.out.println("Negative");
       }
       else if(a==0)
       {
           System.out.println("Neutral");
        }
    }
}

No comments:

Post a Comment

if you have any doubts, Please let me know.
Your Truly
Shashank Porwal

 jhvghvgk ;nkjn ,nkjhj