title: C exit function not doing what I thought it would
body: <p>When I use a debugger I can tell the exit is not exiting the function.  Am I using the exit function wrong? (i must be) how do I fix this?</p>
  
  <pre><code>int is_prime(int x,char array[]){
  int divider = (x-1);   
  float test;
  
    while(x&gt;-1){
    test = isdigit((x % divider));  //isdigit returns !0 if digit
      if(divider == '1'){
      return(1);  //if divider reaches 1 then the number is prime
      exit;
      } 
      if(test  == '0'){
      return (0);//not prime
      exit;
      }
    divider--;
    }
  </code></pre>
  
  <p>}</p>