Output issues in java program
<p>Ok so this program is trying to display the middle digit of a 1-4 digit integer and if it has an even number of digits it should display that there is no middle digits, however I can't get it to output the answer properly, here is the code:</p>

<pre><code>public class digit {
    public static void main(String[] arg) {
        int MyInt1, MyInt2, MyInt3, MyInt4;
        EasyReader keyboard = new EasyReader();
        // Get the 1-4 digit integer
        int MyInt = keyboard.readInt("Enter your integer: ");
        // Calculate the middle digit
        MyInt1=MyInt/10;
        if (MyInt1 &lt; 1) {
            System.out.print("The middle digit is: ");
            System.out.println(MyInt);
        MyInt2=MyInt1/10;
        }else if (MyInt2 &lt; 1) {
            System.out.println("No middle digit");
        MyInt3=MyInt2/10;
        }else if (MyInt3 &lt; 1) {
            System.out.print("The middle digit is: ");
            System.out.println(MyInt2);
        MyInt4=MyInt3/10;
        }else if (MyInt4 &lt; 1) {
            System.out.println("No middle digit");
        }   
    }
}
</code></pre>

<p>I also import a package at the start. </p>

<p>An example output I get is if I enter 1234 as the integer I get: '123412No middle digit' as my answer, I must be doing something wrong with the else if statements I think but I don't know what it is. Help is appreciated, thanks</p>
