daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Mar 19th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class BooleanIf{
  4.     public static void main(String[] args) {
  5.         int a = 0, b = 0;
  6.  
  7.         Scanner in = new Scanner(System.in);
  8.         System.out.print("Input the first number: ");
  9.         a = in.nextInt();
  10.         System.out.print("Input the second number: ");
  11.         b = in.nextInt();
  12.  
  13.         if (a > b)
  14.             System.out.println(a + " is greater than " + b);
  15.  
  16.         else if (a < b)
  17.             System.out.println(a + " is less than " + b);
  18.  
  19.         if (a == b)
  20.             System.out.println(a + " is equal to " + b);
  21.  
  22.         if (a >= b)
  23.             System.out.println(a + " is greater or equal to " + b);
  24.  
  25.         else if (a <= b)
  26.             System.out.println(a + " is less than or equal to " + b);
  27.  
  28.         if (true)
  29.             System.out.println(a + " is not equal to " + b);
  30.        
  31.     }
  32. }
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