title: How to compile C program
body: <p>I am learning C and I have a simple hello world program that I am trying to run on Windows 10. Here is the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      printf("Hello, world!\n");
      return 0;
  }
  </code></pre>
  
  <p>I have installed GCC compiler and I tried the following in order to run it in the command prompt:</p>
  
  <pre><code>gcc hello.c
  a
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>gcc hello.c
  ./a.exe
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>gcc hello.c
  ./a
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>gcc hello.c -o hello
  ./hello
  </code></pre>
  
  <p>The program does not run displaying hello, world and it gives the following error: </p>
  
  <pre><code>bash: a.exe: command not found
  </code></pre>
  
  <p>What am I doing wrong and how can I run the program after the compilation?</p>
  
  <p><a href="https://i.stack.imgur.com/oybFH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oybFH.jpg" alt="console output"></a></p>