desislava_topuzakova

05. Number 100...200

Sep 19th, 2021
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class NumberInRange {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. //1. прочитаме цяло число
  7. int number = Integer.parseInt(scanner.nextLine());
  8.  
  9. //2. проверки
  10. // число < 100 -> Less than 100
  11. // число <= 200 -> Between 100 and 200
  12. // число > 200 -> Greater than 200
  13. if (number < 100) {
  14. System.out.println("Less than 100");
  15. } else if (number <= 200) {
  16. System.out.println("Between 100 and 200");
  17. } else if (number > 200) {
  18. System.out.println("Greater than 200");
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment