title: Using for loop after if /else statement
body: <p>This is just a simple multiplication program using an
  if /
  else and
  for loop.
  Re - entering a positive number from a prompt and assigning it to the num variable which the
  for loop should use is breaking the program.I’ m not sure why it is incorrect. ? Perhaps you could tell me the best way to do this using the
      if /
      else and
      for loop.
  Any help much appreciated.</p>
  
  <pre><code>//Array variable and counter variable
  
  var multi = new Array();
  
  var Counter;
  
  //Enter a number between 1 and 12 and hold in num variable
  
  num = prompt("Enter a number between 1 and 12");
  
  //Check if number is less than zero
  //Reenter positive number
  
  if (num &lt; 0) {
      var num = prompt("Enter a number greater than zero");
  } 
  else {
      //Number entered by user multiplied by counter value
      for (Counter = 1; Counter &lt;= 12; Counter++) {
          multi[Counter] = num * Counter;
      }
      //Loop to display number that is being multiplied each time 
      for (Counter = 1; Counter &lt;= 12; Counter++) {
          document.write(Counter + " x " + num + "  = " + multi[Counter] + '&lt;br/&gt;');
      }
  }
  </code></pre>