Q:

Using while loop for nested if statements

Although I know I'm missing something, can't seem to get my head around a simple loop.
while (true){
if (n < 0)
    System.out.print("less than 0")
else if (n > 35)
    System.out.print("greater than 35")
else
    calc(n)    
}

I'm trying to use a while loop to loop the code and asks for input until the user inputs a value greater than 0 and less than 35, I have tried using continue but too no avail, thanks in advanceenter image description here
I have added sc of full code, the while loop will go after requesting input at the bottom of the code

A:

    // if using jdk 1.7 or above else close scanner in finally block.
    try (Scanner s = new Scanner(System.in)) {

        int n;
        while (true) {
            n = s.nextInt();
            if (n < 0) {
                // ask for value greater then 0
                System.out.print("Please enter a value greater then 0 ");
                // extra print statement so input will be printed on next line after message
                System.out.println();
            } else if (n > 35) {
                // ask for value less then 35
                System.out.print("Please enter a value less then 35");
                System.out.println();
            } else {
                // process input and break if correct input has received
                calc(n);
                break;
            }
        }
    }

