Problem in simple input challenge

code link:


please check

Your code is correct, just create the scanner object outside the while loop because it only needs to be created once. So put this statement :

Scanner scn=new Scanner(System.in);

outside your while loop.