title: Read input until a certain number is typed
body: <p>I need to stop asking for integer inputs when zero is typed as an input and start summation immediately. My program doesn't stop when I type zero. I need it to stop and start summing up all the inputs it has gathered. </p>
  
  <p>Here is what I have:</p>
  
  <pre><code>public class Inttosum {
  
      public static void main(String[] args) {
          System.out.println("Enter an integer");
          Scanner kb = new Scanner(System.in);
          int askool = kb.nextInt();
          int sum = 0;
          int score = 0;
  
  
          while(askool != 0){
            score = kb.nextInt();
            sum += score;
          }
      }
  }
  </code></pre>
  
  <p>/////////////////The final code which worked..Thank you!
      public class Inttosum {</p>
  
  <pre><code>    public static void main(String[] args) {
          System.out.println("Enter an integer");
  
      Scanner kb = new Scanner(System.in);
      int sum = 0;
      int score = 0;
      do {
          score = kb.nextInt();
          sum += score;
  
      }while(score != 0);
      System.out.print(sum); 
   }
  }
  </code></pre>