Assignemnt #81 and Counting Machine Revisited

Code

/// Name: Raff Lisbona
/// Period: 6
/// Program Name: Counting Machine Revisited
/// File Name: CountingMachineRevisited.java
/// Date Finished: 1/26/2015

import java.util.Scanner;
public class CountingRevisited
{
    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.print("Count to  : ");
        to = keyboard.nextInt();
        System.out.print("Count by  : ");
        by = keyboard.nextInt();
        System.out.println(" ");
        
        for( int n = from; n <= to; n = n + by )
            System.out.print(n + " ");
        System.out.println();
    }
}
    

Picture of the output

Assignment 81