borkins

10. Number 100..200

Mar 23rd, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. /*
  2.  * Simple Conditions
  3.  */
  4. import java.util.Scanner;
  5.  
  6. public class _10_Number_100_200
  7. {
  8.     public static void main(String[] args)
  9.     {
  10.         Scanner scan = new Scanner(System.in);
  11.        
  12.         int number = Integer.parseInt(scan.nextLine());
  13.        
  14.         // If true: number is between 'Integer.MIN_VALUE' and 99, execute next statement/s
  15.         // If false: number is between 100 and 'Integer.MAX_VALUE', skip and continue
  16.         if (number < 100) {
  17.             System.out.println("Less than 100");
  18.  
  19.         // If true: number is between 100 and 200, execute next statement/s
  20.         // If false: number is between 201 and 'Integer.MAX_VALUE', skip and continue
  21.         } else if (number <= 200) {
  22.             System.out.println("Between 100 and 200");
  23.  
  24.         // Execute next statement/s, no matters how much number is greater than 200
  25.         } else {
  26.             System.out.println("Greater than 200");
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment