title: for loop to count up to user number
body: <p>I want the user to input a number and for the program to output all number up to that number. Instead of printing number in a sequence (1,2,3 etc.) it prints the user number and adds one to it.</p>
  
  <pre><code>import java.util.*;
  
  public class Count
  {
    public static final Scanner CONSOLE = new Scanner(System.in);
    public static void main(String [] args)
  {
      int lastNumber = 0;
  
      System.out.println("Enter number to count up to: ");
      lastNumber = CONSOLE.nextInt();
  
      int k = 1;
  
      for(; k&lt;=lastNumber; k++);
      {
          System.out.print(k);
      }
  }
  
  }
  </code></pre>