Assignment #81 and Counting Machine Revisited
Code
//Name: Mark Katz
///Period: 6
///Program Name: Counting Machine Revisited
///File Name: countrev.java
///Date Finished: 11/5/15
import java.util.Scanner;
public class countrev
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int to, from, 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();
for ( int n = from; n <= to; n = n + by )
{
System.out.println( n + " " );
}
System.out.println( " " );
}
}
Picture of the output