title: Using while loop for nested if statements
body: <p>Although I know I'm missing something, can't seem to get my head around a simple loop.</p>
  
  <pre><code>while (true){
  if (n &lt; 0)
      System.out.print("less than 0")
  else if (n &gt; 35)
      System.out.print("greater than 35")
  else
      calc(n)    
  }
  </code></pre>
  
  <p>I'm trying to use a <code>while loop</code> 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 advance<a href="https://i.stack.imgur.com/VWlWf.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>I have added sc of full code, the while loop will go after requesting input at the bottom of the code</p>