Advertisement
CamiloCastilla

Untitled

Dec 5th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package com.company;
  2. import java.util.Scanner;
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner keyboard=new Scanner(System.in);
  7.  
  8.         System.out.println("Count from: ");
  9.         int from=keyboard.nextInt();
  10.         System.out.println("Count to: ");
  11.         int to=keyboard.nextInt();
  12.         System.out.println("Count by: ");
  13.         int by=keyboard.nextInt();
  14.  
  15.         for (int n=from ; n <= to;  n=n+by) {
  16.             System.out.print(n+"\n");
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement