title: Why does my program's output flash and close in Windows?
body: <p>I'm trying to build an .exe file for the K&amp;R "Hello, world".  The code given in the book is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;  
  main()  
  {  
      printf("Hello, world!\n");  
  }  
  </code></pre>
  
  <p>When I build &amp; run from Code::Blocks (under Windows XP), I get the prompt window with the "hello world" message. It stays open until I close it manually. However, when I double click the .exe file, the prompt just flashes and disappears, why is that?</p>