title: Printing the last number only from a loop
body: <p>If I have a while loop that goes through a file and prints the numbers, how would I make it to where it only prints the very last number. </p>
  
  <pre><code>0
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  </code></pre>
  
  <p>This is the output I'm currently getting. How would I make get it to where it would just print out <code>19</code></p>
  
  <p>And how would I get it to work to where the numbers start at 1 instead of 0?</p>
  
  <p>Currently my loop looks like this:</p>
  
  <pre><code>if (math == last){
          System.out.println(Score++);
      }
  </code></pre>
  
  <p>math is another method which computes equations, and last is the answer inputed from a file, and the loop currently just checked if the math matches the inputed answer in order to "grade" the problems. </p>
  
  <p>I can't use arrays, try/catch, or regex. </p>