title: echo $? behaves differently
body: <p>I have this C program:</p>
  
  <pre><code>int main() { return 10; }
  </code></pre>
  
  <p>After running this when I write <code>echo $?</code> in the terminal its prints <code>10</code>.</p>
  
  <p>Now suppose I have a <code>.sh</code> file:</p>
  
  <pre><code>echo $?
  </code></pre>
  
  <p>After running the C program if I run the <code>.sh</code> file it prints <code>0</code>.</p>
  
  <p>Why?</p>