Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- Scanner input = new Scanner(System.in);
- while (true) {
- System.out.println("Please enter the number 0.");
- n = stdin.netxtInt();
- if ( n != 0 ) {
- System.out.println("Sorry, that was not the correct number. Please try again.");
- continue;
- else if ( n = 0 ) {
- System.out.println("Yes, that was the correct number!");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement