title: Running a C program in Visual Studio Code (or VS2019)
body: <p>I've just downloaded VS Code, and am struggling to work out the basics of running any programs. I'm attempting to run a basic Hello World program in C:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main() {
      printf("Hello, World!");
      return 0;
  }
  </code></pre>
  
  <p>I found out that I needed to download a C compiler to run C programs on VS-Code, so I downloaded Visual Studio with C++ <a href="https://visualstudio.microsoft.com/vs/features/cplusplus/" rel="nofollow noreferrer">from the Microsoft website</a>, which basically installed Visual Studio 2019. The heading on the link said "Develop C and C++ applications", so I figured it would at least let me program in C.</p>
  
  <p>After doing this, in VS-Code I downloaded the C/C++ extension from Microsoft, and the Code Runner extension by Jun Han, which was recommended by a <a href="https://www.youtube.com/watch?v=tQTrs5G0H5c" rel="nofollow noreferrer">YouTube video</a>. I then selected the Run Code (...environment? application?), and pressed the Play button on the top-right. The output in the terminal was:</p>
  
  <pre><code>[Running] cd "c:\Users\Leo\Documents\VSC Test Project\" &amp;&amp; gcc test.c -o test &amp;&amp; "c:\Users\Leo\Documents\VSC Test Project\"test
  'gcc' is not recognized as an internal or external command,
  operable program or batch file.
  
  [Done] exited with code=1 in 0.078 seconds
  </code></pre>
  
  <p>I don't understand the error - so I opened Visual Studio 2019 to see if I could develop C applications in that. But no, only C++. Did Microsoft lie to me, or is there something else I need to do to configure C in VS2019?</p>
  
  <p>Basically, I have no idea what I'm doing in VS-Code, and would really appreciate someone taking the time to break down how to actually run a program in there, and get C working. Or if there's a simple solution that allows me to write C in VS-2019, that would be equally great.</p>