title: How can I make my c++ program to countinue?
body: <p>I wrote this to find out which 10-digit numbers are prime but it stops after showing about 20 numbers at all. Would you help me figure out what's wrong? Or suggesting any other sources? It's important to me as it's my school project.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;windows.h&gt;
  using namespace std;
  void temp()
  {
      static long long n1=9999999999 ;
      long long n2,n3;
      if (n1 &lt;= 1 || n1%2==0|| n1%3==0|| n1%5==0|| n1%7==0|| n1%11==0|| n1%13==0|| n1%17==0|| n1%19==0|| n1%23==0|| n1%29==0|| n1%31==0|| n1%37==0|| n1%41==0|| n1%43==0|| n1%47==0|| n1%53==0|| n1%59==0|| n1%61==0|| n1%67==0|| n1%71==0|| n1%73==0|| n1%79==0|| n1%83==0|| n1%89==0|| n1%97==0)
      {
          std::cout&lt;&lt; n1 &lt;&lt; &quot;    not prime\n\n&quot;;
          n1--;
          temp();
      }
      else
      {
          n2 = (n1 - 1)/2;
          while (n2 &gt; 1)
          {
  
              n3 = n1 % n2;
              if (n3 == 0)
              {
                  std::cout&lt;&lt; n1 &lt;&lt; &quot;    not prime\n\n&quot;;
              }
              else
              {
                  n2--;
              }
          }
          std::cout&lt;&lt; n1 &lt;&lt; &quot;    prime\n\n&quot;;
          n1--;
          temp();
      }
  }
  
  int main(int argc, char** argv)
  {
      temp();
      return 0;
  }
  </code></pre>