part of bigger code but i cant understand why its not working in the correct range
Scanner input3 = new Scanner (System.in);
System.out.println("Enter House Number;");
houseNumber = input3.nextInt();
do {
System.out.println("You must enter a house number between 1 and 1000");
System.out.println("Enter House Number;");
houseNumber = input3.nextInt();
}while ((houseNumber <1) || (houseNumber >1000));
it says i.e. 999 is wrong basically were it should accept and move onto the next stage but its stuck in the loop as it think 999 is wrong were it should be anything below 1 and above 1000 that is invalid and only looped.