Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Simple Conditions
- */
- import java.util.Scanner;
- public class _10_Number_100_200
- {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- int number = Integer.parseInt(scan.nextLine());
- // If true: number is between 'Integer.MIN_VALUE' and 99, execute next statement/s
- // If false: number is between 100 and 'Integer.MAX_VALUE', skip and continue
- if (number < 100) {
- System.out.println("Less than 100");
- // If true: number is between 100 and 200, execute next statement/s
- // If false: number is between 201 and 'Integer.MAX_VALUE', skip and continue
- } else if (number <= 200) {
- System.out.println("Between 100 and 200");
- // Execute next statement/s, no matters how much number is greater than 200
- } else {
- System.out.println("Greater than 200");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment