Assignemnt #80: Counting Machine
Code
/// Name: Kelsey Lieberman
/// Period 5
/// Program Name: CountingMachine
/// File Name: CountingMachine.java
/// Date Finished: 1/4/2016
import java.util.Scanner;
public class CountingMachine
{
public static void main( String[] args )
{
Scanner s = new Scanner(System.in);
System.out.println("Type in a number and i'll count to it from zero");
System.out.print("> ");
int x = s.nextInt();
for (int z=0 ; z<=x ; z++)
System.out.print(z + "\t");
System.out.println();
}
}
Picture of the output