- import java.util.Scanner;
- public class InputRange
- {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- System.out.println ("What number starts the range?");
- String f = scan.nextLine();
- System.out.println ("what number ends the range?");
- String s = scan.nextLine();
- System.out.println("what number do you increment by?");
- String t = scan.nextLine();
- System.out.println("The numbers in the range from " + f + " to " + s + " incremented by " + t);
- int first = Integer.parseInt(f);
- int second = Integer.parseInt(s);
- int third = Integer.parseInt(t);
- while (first < third)
- {
- System.out.println("count is : " + f);
- first++;
- first=+third;
- }
- }
- }

By: microhaxo | Date: Nov 12 2008 02:01 | Format: None | Expires: never | Size: 733 B | Hits: 1070
Latest pastes
1 hours ago
1 hours ago
1 hours ago
3 hours ago
6 hours ago