- import java.util.Scanner;
- public class InputRange
- {
- public static void main(String[] args)
- {
- String f ="0";
- String s ="0";
- String t ="0";
- Scanner scan = new Scanner(System.in);
- System.out.println ("What number starts the range?");
- f = scan.nextLine();
- System.out.println ("what number ends the range?");
- s = scan.nextLine();
- System.out.println("what number do you increment by?");
- 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;
- }
- }
- }
whileloop
By: microhaxo | Date: Nov 12 2008 01:59 | Format: None | Expires: never | Size: 764 B | Hits: 1113
Latest pastes
18 hours ago
1 days ago
1 days ago
1 days ago
2 days ago