title: C program working and stop running at the same time?
body: <h1>How can I run this program without any crash #C #CoFactors</h1>
  <p>This program is about finding cofactors of a number it is working but at the same time this program crashes after showing the output. Please take a look.</p>
  <p>Here is the program.</p>
  <pre><code>int coFactors(int number,int divisor)
  {
  if(number%divisor==0)
  {
      printf(&quot;%d &quot;,divisor);
      number /= divisor;
      coFactors(number,divisor);
  }
  else if(number==divisor-1)
  {
      return;
  }
  else
  {
      coFactors(number,++divisor);
  }    
               }                                 
             
  int main()            
  {                
  int num;                  
  printf(&quot;Enter number:&quot;);               
  scanf(&quot;%d&quot;,&amp;num);              
  coFactors(num,2);
  
  return 0;         
  }                
  </code></pre>