Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement