Assignment #81

Code

    
    ///Name: Cody Swain
    ///Period: 6
    ///Project Name: CountingMachine2
    ///File Name: CountingMachine2.java
    ///Date: 1/12/16
    
    
    import java.util.Scanner;

    public class CountingMachine2
    {
        public static void main( String[] args )
        {
            Scanner keyboard = new Scanner(System.in);
            int a, b, c;
            
            System.out.print( "Count from: " );
            a = keyboard.nextInt();
            System.out.print( "Count to  : " );
            b = keyboard.nextInt();
            System.out.print( "Count by  : " );
            c = keyboard.nextInt();
            
            for ( int x = a; x <= b; x = x+c ){
                System.out.print( x + " " );
            }
            
            System.out.println();
        }
    }


    

Picture of the output

Assignment 81