Assignemnt #81 and Counting Machine Revistied
Code
///name: Ben Borglin
///Period: 6
///Program name: Counting Machine 2
///File Name: CountMachine2.java
///Date Finished: 10/29/15
import java.util.Scanner;
public class CountMachine2
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int from, to, by;
System.out.print("Count from: ");
from = keyboard.nextInt();
System.out.println(" ");
System.out.print("Count to: ");
to = keyboard.nextInt();
System.out.println(" ");
System.out.print("Count by: ");
by = keyboard.nextInt();
for (int n = from; n <= to; n = n + by)
{
System.out.print(n + " ");
}
System.out.println( " ");
}
}