this program only asks me the first input
Enter The Max Value
then the whole program stops


public static void main(String[] args) {

int count = 0;

...