title: runtime error (NZEC) Java SPOJ
body: <p>I'm trying to do a SPOJ problem called Prime Generator. Although the output works on my computer it doesn't work when I try to run it on SPOJ. The following error message occurs.</p>
  
  <p>Error: runtime error (NZEC)</p>
  
  <p>Can you help me find what it is?</p>
  
  <pre><code>import java.util.BitSet;
  import java.util.Scanner;
  
  
  class Prime_generator {
  
  
  public static void main(String[] args) {
      Scanner input=new Scanner(System.in);
  
      int number_of_entries=input.nextInt();
      int [] entries=new int[number_of_entries*2];
  
      for(int i=0;i&lt;number_of_entries*2;i++){
          entries[i]=input.nextInt();
      }
  
  
      BitSet bits=new BitSet(1000000002);
  
      bits.set(0, 1000000000);
      bits.set(0,false);
      bits.set(1,false);
      for(int i=2;i&lt;=Math.sqrt(1000000001);i++){
  
          if(bits.get(i)){
  
              for(int j=2;j*i&lt;=100000000;j++){
  
              bits.set(j*i, false);
  
                  }
          }
  
      }   
  
      int i=0;
  
      int starting_index=0;
      int ending_index=0;
  
      int array_index=0;
      while(i&lt;number_of_entries){
  
          starting_index=entries[array_index];
          ending_index=entries[array_index+1];
          array_index+=2;
          for(int k=starting_index;k&lt;=ending_index;k++){
              if(bits.get(k)){
  
                  System.out.println(k);
              }
  
          }
          System.out.println();
          i++;
      }
  
  
      System.exit(0);
  
  
  }
  </code></pre>
  
  <p>}</p>