63 132
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #3127 in Java | JSP | JSF for ksimran

Question #3127
Input a number and find whether it is positive or negative.
Expert's answer
public class Program {
& public static void main(String[] args) {
& java.util.Scanner kb = new java.util.Scanner(System.in);
& System.out.print("Please enter number: ");
& double number = Double.parseDouble(kb.nextLine());
& if (number<0)
System.out.println("Negative");
& else if (number>0)
System.out.println("Positive");
& else
System.out.println("Zero");
& }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions