Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. int n;
  2.  
  3.  
  4. Scanner input = new Scanner(System.in);
  5.  
  6.  
  7. while (true) {
  8. System.out.println("Please enter the number 0.");
  9. n = stdin.netxtInt();
  10. if ( n != 0 ) {
  11. System.out.println("Sorry, that was not the correct number. Please try again.");
  12.  
  13. continue;
  14.  
  15. else if ( n = 0 ) {
  16.  
  17. System.out.println("Yes, that was the correct number!");
  18.  
  19. break;
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement