Assignment 81: Counting Machine Revisited

Code

    /// Name: Ryan McAteer
    /// Period: 5
    /// Program Name: Counting Machine Revisited
    /// File Name: Assignment81.java
    /// Date Finished: 2/25/16
    
import java.util.Scanner;

public class Assignment81
{
	public static void main( String[] args )
	{
        Scanner keyboard = new Scanner(System.in);
        int countFrom, countTo, countBy, n;
        System.out.print( "Count from: " );
        countFrom = keyboard.nextInt();
        System.out.print( "Count to: " );
        countTo = keyboard.nextInt();
        System.out.print( "Count by: " );
        countBy = keyboard.nextInt();
        System.out.println();
        for ( n = countFrom; n <= countTo; n = n + countBy )
        { 
            System.out.print( n + " " );
        }
        System.out.println();
    } 
}
    

Picture of the output

This Should Work