Clock 4-12

Post date: Mar 4, 2014 7:17:03 PM

/*

This program uses nested loops to simulate a clock.

*/

package clock;

public class Clock {

/**

* @param args the command line arguments

*/

public static void main(String[] args)

{

// TODO code application logic here

// Simulate the clock.

for (int hours =1; hours <= 12; hours++)

{

for (int minutes = 0; minutes <= 59; minutes++)

{

for (int seconds =0; seconds <= 59; seconds++)

System.out.printf("%02d:%02d:%02d\n",hours, minutes, seconds);

}

}

}

}