Write a program that can receive two numbers and determine whether the two numbers are greater than, less than, or equal ?, Write and receive
// Author: janushu // Date: 2017/9/20 // function to determine the size of two numbers import java. io. *; public class CompareToNumDemo {public static void main (String [] args) {try {// enter a number of InputStreamReader isr = new InputStreamReader (System. in); // The cache reads a number of BufferedReader br = new BufferedReader (isr); System. out. println ("Enter the first number"); // read a row of data from the console String snum1 = br. readLine (); System. out. println ("enter the second number"); String snum2 = br. readLine (); float fnum1 = Float. parseFloat (snum1); float fnum2 = Float. parseFloat (snum2); if (fnum1> fnum2) {System. out. println (fnum1 + "greater than" + fnum2);} if (fnum1 = fnum2) {System. out. println (fnum1 + "equals" + fnum2);} if (fnum1> fnum2) {System. out. println (fnum1 + "less than" + fnum2) ;}} catch (Exception e) {System. out. println ("unable to judge ");}}}