Assignement: #80 Counting to a Specific Number From 0
Code
/// Name: Sean Harrison
/// Period: 7
/// Program name: CountingMachine
/// File Name: CountingMachine.java
/// Date Finished: 12/16/2016
import java.util.Scanner;
public class CountingMachine
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
int Number, n;
Number = 0;
n = 0;
System.out.println( "Type in a number, and I'll count up to it from 0. " );
System.out.print( "Number: " );
Number = keyboard.nextInt();
for ( n = 0; n <= Number; n++ )
{
System.out.println( n + " " );
}
}
}
Picture of the output