Assignemnt #81 and Counting Machine Revisited
Code
/// Name: Kyle Ivy
/// Period: 5
/// Program Name: CountingMachine
/// File Name: Revisited.java
/// Date Finished: 1/5/2016
import java.util.Scanner;
public class Revisited {
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();
}
}
prog81.PNG