title: 4.23 Lab countdown until matching digits in Java
body: <p>So i have this lab and i kept getting 9 out of ten correct. I ended up changing my original code to this very wacky version to accommodate the extra point. The question is:</p>
  
  <p>Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.</p>
  
  <p>my code:</p>
  
  <pre><code>import java.util.Scanner;
  public class LabProgram {
     public static void main(String[] args) {
        Scanner scnr = new Scanner(System.in);
        int userDigit;
        int newDigit;
  
        userDigit = scnr.nextInt();
  
        newDigit = userDigit - 1;
  
        if ((userDigit &gt; 19) &amp;&amp; (userDigit &lt; 99)) {
           System.out.print(userDigit + " ");
  
        }
        else {
           System.out.println("Input must be 20-98");
        }
  
  
        while ((userDigit &gt; 19) &amp;&amp; (userDigit &lt; 99) &amp;&amp; (newDigit % 11 != 0)) {
           if (userDigit % 11 == 0) {
              System.out.println();
              break;
           }
           System.out.print(newDigit + " ");
           --newDigit;
  
           if (newDigit % 11 == 0) {
              System.out.println(newDigit + " ");
              break;
           }
        }
  
  
     }
  }
  </code></pre>
  
  <p>Can someone please tell me if i over thought this and if there was an easier way to format the for loop without having all the "ifs". I am new at this and have been taking the class for 4 weeks now. Any suggestions would be greatly appreciated. I know there was probably some way to use another method, but the instructions stated to use a "while" loop. </p>