Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- System.out.println();
- System.out.print("Count from: ");
- Scanner keyboard1 = new Scanner(System.in);
- int num1 = keyboard1.nextInt();
- System.out.print("Count to: ");
- Scanner keyboard2 = new Scanner(System.in);
- int num2 = keyboard2.nextInt();
- System.out.print("Count by: ");
- Scanner keyboard3 = new Scanner(System.in);
- int num3 = keyboard3.nextInt();
- int n;
- System.out.println();
- for (n=num1 ; n <= num2 ; n = n+num3){
- System.out.print(n + " ");
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement