sudoaptinstallname

6.22

Jan 23rd, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. package com.company;
  2. /*
  3. Amon Guinan
  4. Wednesday, January 23, 2019
  5. */
  6. //Prints ints except 20.
  7.  
  8. import java.util.Scanner;
  9.  
  10. public class six_twentyTwo {
  11. public static void main(String [] args)
  12. {
  13. System.out.print("Enter a starting integer: ");
  14. Scanner input = new Scanner(System.in);
  15. int y = input.nextInt();
  16. if (y == 20)
  17. {
  18. System.out.print("No 20 allowed.");
  19. System.exit(20);
  20. }
  21. int i;
  22. do {
  23. i = input.nextInt();
  24. if (i == 20)
  25. {
  26. System.out.print("No 20 allowed.");
  27. System.exit(20);
  28. }
  29. System.out.println(i);
  30. }
  31. while((i>=y)&&(i!=20));
  32. }
  33. }
Add Comment
Please, Sign In to add comment