title: Write a program to read two numbers, the first less than the second. The program will write all numbers between the two numbers
body: <p>//So I wrote this: (the output down there)</p>
  
  <pre><code>import java.util.Scanner;
  public class E7L6{
  public static void main(String[]args){
  int num1, num2;
  Scanner keyboard= new Scanner(System.in);
  System.out.print("Type two numbers:");
  num1= keyboard.nextInt();
  num2= keyboard.nextInt();
  
  if(num1&lt;num2){
     while(num1&lt;=num2){
     int counter=num1;
     System.out.print(counter+" "+num2);
     counter=counter+1;
     }}
  else{
     System.out.print("Error: the first number must be smaller than the second");
  }   
    }}
  
  Output:
   ----jGRASP exec: java E7L6
  Type two numbers:4 124
   4 4 4 4 4 4 4 4 4
   ----jGRASP: process ended by user.
  </code></pre>
  
  <p>//so many number 4 repeating can someone tell me where am i wrong? thanks!!</p>