Assignment 81

Code

///Matthew Hughs
///5th period
///Spec.java
///3/31/2016

import java.util.Scanner;

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

Picture of the output

Countingfor