I want to count a range of number with a for loop using input from scanner.
Tried writing the code but still no results
package com.example.myapplication;
import java.util.Scanner;
public class dsd {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter first number:");
int firstnum = sc.nextInt();
System.out.println("Enter first number:");
int secondnum = sc.nextInt();
System.out.print("counting ");
for (int i = firstnum; i >= secondnum; i++) ;
{
System.out.print(i);
}
}
Upper limit :5
Lower Limit :2
Expected to see COunting 2 ,3 ,4, 5