title: Writing a For loop that prints 1 2 ... userNum?
body: <p>I am not sure what I am doing wrong here. Here is the original prompt:</p>
  
  <p>"Write a <code>for-loop</code> that prints: 1 2 .. userNum. Print a space after each number, including after the last number. Ex: <code>userNum = 4</code> prints:
  <code>1 2 3 4</code>"</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class CountToNum {
  
      public static void main (String [] args) {
  
        int userNum = 0;
        int i = 0;
  
        userNum = 4;
  
        for (userNum = 1; userNum &lt;= 4; ++userNum) {
           System.out.print(userNum + " ");  
        }
  
        System.out.println("");
  
        return;
      }
  }
  </code></pre>