filipparodriguezz

Untitled

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