SHARE
TWEET

Bounds

a guest Feb 16th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Bounds {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner in = new Scanner(System.in);
  7.         System.out.print("Enter Starting number:");
  8.         int starting_number = in.nextInt();
  9.         System.out.print("Enter Starting number:");
  10.         int upper_bound = in.nextInt();
  11.         System.out.print("Enter Step Size:");
  12.         int step_size = in.nextInt();
  13.         int num = starting_number, count = 0;
  14.         while (num < upper_bound) {
  15.             System.out.print(num + "");
  16.             count++;
  17.             if (count% 10 == 0)
  18.                 System.out.println();
  19.             num+=step_size;
  20.         }
  21.         System.out.println();
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top