title: Ask for yes/no to go back to the loop
body: <p>How do i go back to the <strong>try</strong> loop if the user answers Y/y? I know the code below doesn't ask for the user's <strong>Do you want to try again (Y/N)?</strong>. I can only use bufferedReader at the moment. </p>
  
  <pre><code>import java.io.*;
  
  public class Num10 {
      public static void main(String[] args){
          String in="";
          int start=0, end=0, step=0;
  
          BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
  
  
          try{
              System.out.print("Input START value = ");
              in=input.readLine();
              start=Integer.parseInt(in);
              System.out.print("Input END value = ");
              in=input.readLine();
              end=Integer.parseInt(in);
              System.out.print("Input STEP value = ");
              in=input.readLine();
              step=Integer.parseInt(in);
          }catch(IOException e){
              System.out.println("Error!");
          }
  
          if(start&gt;=end){
              System.out.println("The starting number should be lesser than the ending number");
              System.exit(0);
          }else
          if(step&lt;=0){
              System.out.println("The step number should always be greater than zero.");
              System.exit(0);
          }
  
          for(start=start;start&lt;=end;start=start+step){
              System.out.println(start);
          }       
  
          System.out.println("\nDo you want to try again (Y/N)?");
      }
  }
  </code></pre>