SHARE
TWEET

01.TheBiggerNum

a guest Feb 17th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         System.out.println("Please enter your first number : ");
  7.         double firstNum = scanner.nextDouble();//Get first num from user.
  8.         System.out.println("Please enter your second number : ");
  9.         double secondNumber = scanner.nextDouble();//Get second num from user.
  10.  
  11.         scanner.close();
  12.         if (firstNum == secondNumber) {
  13.             System.out.println("The two numbers are equals!");
  14.         } else {
  15.             System.out.println("The bigger number is : " + Math.max(firstNum, secondNumber) + " !");
  16.         }
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top