Clock 4-12

posted Mar 4, 2014, 11:17 AM by dldar masud   [ updated Mar 4, 2014, 11:17 AM by Karwan Jacksi ]
/*
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);
         }
   }
    
    
    }
}

ċ
Clock.java
(1k)
Karwan Jacksi,
Mar 4, 2014, 11:17 AM
Comments