Advertisement
GameNCode

Solution for test question

Oct 25th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public class Main {
  2. public static void main(String[] args)
  3. {
  4. Scanner UI = new Scanner(System.in);
  5. String save = "";
  6. int last = -1;
  7. System.out.println("Enter number");
  8. int userNum = UI.nextInt();
  9. while(last < userNum)
  10. {
  11. save += userNum + ", ";
  12. System.out.println("Enter number that is bigger than last");
  13. last = userNum;
  14. userNum = UI.nextInt();
  15.  
  16. }
  17. System.out.println(save);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement