title: my eclipse crash after use this code (cpu 100% ) , can anyone confirm if the code work or not
body: <p>My Eclipse crashs after using this code (cpu 100% ) , can anyone confirm if the code work or not. I don't know if crash because the code wrong or not </p>
  
  <p>here is the code below</p>
  
  <pre><code>import java.util.Scanner;
  
  
  public class ClassStudent {
  
      public static void main(String[] args) {
  
          Scanner input = new Scanner(System.in);
  
          int A=0;
          int F=0;
          int total=0;
          int counter=0;
          double Av12;
          int pass=0;
          int fail=0;
          int grade;
  
          System.out.println("enter grades or enter -1 to exit  :  ");
          grade=input.nextInt();
  
          while(grade&gt;=0) {
  
              if (grade&gt;90 &amp;&amp; grade&lt;=100) {
                  A++;
              pass++;
              }
  
              if (grade&gt;0 &amp;&amp; grade&lt;=59) {
                  F++;
              fail++;
              }
  
  
              total=total+grade;
              counter++;
  
          }
  
          System.out.println("the total is "+total);
          Av12=(double)total/counter;
          System.out.printf("the averge is %.2f %n ",Av12);
  
          System.out.printf("num of A is %d %n and F is %d%n and fail is %d%n and pass is %d%n ",A,F,fail,pass);
  
      }
  
  }
  </code></pre>