title: find highest and 2nd highest digit in a number
body: <p>After finding the highest digit in a number,how to find the 2nd highest digit in that same number using only loops and if statements?</p>
  
  <pre><code>    public static int maximum(int max){
  
  while(num != 0){
              int rightDigit = num % 10;
              num /= 10;
              if(rightDigit &gt; max)
                  rightDigit = max;
          }
          return max;
          }
  </code></pre>