title: Difference between return 1, return 0, return -1 and exit?
body: <p>For example consider following code:</p>
  
  <pre><code>int main(int argc,char *argv[])
  {
     int *p,*q;
     p = (int *)malloc(sizeof(int)*10);
     q = (int *)malloc(sizeof(int)*10);
     if (p == 0)
  {
      printf("ERROR: Out of memory\n");
          return 1;
  }
  
  
     if (q == 0)
  {
      printf("ERROR: Out of memory\n");
          exit(0);
  }
  
     return 0;
  }
  </code></pre>
  
  <p>What does <code>return 0</code>, <code>return 1</code>, <code>exit(0)</code> do in the above program?
  <code>exit(0)</code> will exit total program and control comes out of loop but what happens in case of <code>return 0</code>, <code>return 1</code>, <code>return -1</code>.</p>