Advertisement
IanO-B

Untitled

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