title: My clock code stops working at Ten O' Clock
body: <p>My clock code works at every other hour except ten o' clock. At every other hour, it increments minutes by 1 every time seconds is 60, but at ten o' clock, for some reason, it increments minutes by 1 every time seconds is 10. I don't know what I did wrong. Please help!</p>
  
  <pre><code>package misk;
  
  
  public class Misk {
     public static void main(String[] args) throws InterruptedException {
        int x = 0;
        int sec = 0, min = 0, hour = 9;
        while (x == 0) {
           Thread.sleep(10);
           sec++;
           if (sec == 60) {
              sec = 0;
              min++;
           }
           if (min == 60) {
              min = 0;
              hour++;
           }
           if (sec &lt; 10) {
              if (min &lt; 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":0" + min + ":0" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min &lt; 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":0" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min &gt; 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":" + min + ":0" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min &lt; 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":0" + min + ":0" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min &gt; 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min &gt; 10) {
                 if (hour &gt; 10) {
                    System.out.println("0" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min &lt; 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":0" + min + ":" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min &gt; 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min == 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min == 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min &gt; 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min == 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min &gt; 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min &gt; 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min == 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min == 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min &lt; 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":0" + min + ":" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min == 10) {
                 if (hour &lt; 10) {
                    System.out.println("" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min &lt; 10) {
                 if (hour == 10) {
                    System.out.println("" + hour + ":0" + min + ":0" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min &lt; 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":0" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min == 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":" + min + ":0" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min &lt; 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":0" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min == 10) {
                 if (hour &gt; 10) {
                    System.out.println("" + hour + ":" + min + ":0" + sec);
                 }
              }
           }
           if (sec &gt; 10) {
              if (min == 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":" + min + ":" + sec);
                 }
              }
           }
           if (sec &lt; 10) {
              if (min == 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":" + min + ":0" + sec);
                 }
              }
           }
           if (sec == 10) {
              if (min &gt; 10) {
                 if (hour &lt; 10) {
                    System.out.println("0" + hour + ":" + min + ":" + sec);
                 }
              }
           }
        }
     }
  }
  </code></pre>