Assignment 112, Odometer Loops
Code
///Name: Stella Koliavas
///Period: 5
///Program Name: Od Loops
///File Name: OdLoops.java
///Date Finshed: 5/9/16
import java.util.Scanner;
public class OdLoops
{
public static void main( String[] args ) throws Exception
{
Scanner siri = new Scanner(System.in);
System.out.print("What number do you want as a base: ");
int x = siri.nextInt();
for ( int thous=0; thous< x; thous++ )
for ( int hund=0; hund< x; hund++ )
for ( int tens=0; tens< x; tens++ )
for ( int ones=0; ones< x; ones++ )
{
System.out.print( " " + thous + "" + hund + "" + tens + "" + ones
+ "\r" );
Thread.sleep(50);
}
System.out.println();
}
}//loops still work w/o all the outside braces
Picture of the output