Assignemnt #112 Odometer Loops

Code

 import java.util.Scanner;

    public class OdometerLoops
    {
        public static void main( String[] args ) throws Exception
        {

            Scanner keyboard = new Scanner(System.in);

            System.out.print("Which base? (2-10): ");
            int a = keyboard.nextInt();
            
            for ( int thous=0; thous < a; thous++ )
                for ( int hund=0; hund < a; hund++ )
                    for ( int tens=0; tens < a; tens++ )
                        for ( int ones=0; ones < a; ones++ )
                        {
                        System.out.print( " " + thous + "" + hund + "" + tens + "" + ones + "\r" );
                        Thread.sleep(10);
                        }

            System.out.println();
        }
    }
/* 1. Yes the program does work.
/*
    

Picture of the output

Assignment 1