Your algorithm is very weak from what I’ve seen,
it’s been a long time since I programmed in java, I made a code here very fast and without testing obviously, but I believe it solves your problem.
Focus on your algorithm.
import java.util.Scanner;
public class MyClass {
public static void main(String args[]) {
Scanner ler = new Scanner(System.in);
int maior;
int menor;
System.out.println("digite um numero");
menor = ler.nextInt();
System.out.println("outro numero");
maior = ler.nextInt();
do{
menor++;
System.out.println(menor);
} while(menor < maior);
}
}