Question: Write an application that works as a comparator. Your program should read two numbers from the user and print 0 if they are equal to
Write an application that works as a comparator. Your program should read two numbers from the user and print 0 if they are equal to each other, 1 if the first number is greater, and –1 if the second number is greater.
Step by Step Solution
3.41 Rating (164 Votes )
There are 3 Steps involved in it
We will use the Scanner class in Java to get inputs from the user Here is a simple Java program that ... View full answer
Get step-by-step solutions from verified subject matter experts
