grodek118

From where to where?

Apr 17th, 2022 (edited)
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner scanner = new Scanner(System.in);
  9.         System.out.println("Where to?");
  10.         int num1 = Integer.valueOf(scanner.nextLine());
  11.         System.out.println("Where from?");
  12.         int num2 = Integer.valueOf(scanner.nextLine());
  13.  
  14.         for (int i = num2; i <= num1; i++) {
  15.             System.out.println(i);
  16.         }
  17.     }
  18. }
Add Comment
Please, Sign In to add comment