Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- /*
- Amon Guinan
- Wednesday, January 23, 2019
- */
- //Prints ints except 20.
- import java.util.Scanner;
- public class six_twentyTwo {
- public static void main(String [] args)
- {
- System.out.print("Enter a starting integer: ");
- Scanner input = new Scanner(System.in);
- int y = input.nextInt();
- if (y == 20)
- {
- System.out.print("No 20 allowed.");
- System.exit(20);
- }
- int i;
- do {
- i = input.nextInt();
- if (i == 20)
- {
- System.out.print("No 20 allowed.");
- System.exit(20);
- }
- System.out.println(i);
- }
- while((i>=y)&&(i!=20));
- }
- }
Add Comment
Please, Sign In to add comment