Print numbers from x till y using while loop(x and y both included) where x and y is taken as input from the user using while loop.
Input Format
x and Y are given to you as Input
Constraints
x
Output Format
Print from X to Y(both Included)
Sample Input 0
10
15
Sample Output 0
10
11
12
13
14
15
Explanation 0
x is 10 y is 15 Printing Done from 10 to 15
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
int y=sc.nextInt();
int i=x;
while(i<=y){
System.out.println(i);
i++;
}
}
}