Write a program that reads two integers start and end from the user and prints the number from start to end inclusive. However, If end was less than start than you should print them in descending order.
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int start = scan.nextInt();
int end = scan.nextInt();
if(start < end)
for(int i = start; i <= end; i++)
System.out.print(i + " ");
else if(start > end)
for(int i = start; i >= end; i--)
System.out.print(i + " ");
}
}