How to write and run a C program in Microsoft Visual Studio

  • Open Microsoft Visual Studio.
  • Go to File > New Project. 


  • Go to Other Languages > Visual C++ > General.
  • Choose Empty Project and give a name. 
  • From the Application Wizard, click on Next button.

  • Next screen is of Application Setting. You need to make sure
  • Application type is set a Console Application.
  • In Additional options, check Empty Project so that the Precompiled Header will be automatically deselected. Click Finish.

  • There are 3 files (Header Files, Resource Files and Source Files). 
  • Among them, right click on Source Files and Go to Add > New Item. 
  • There you will go for C++ File (.cpp).
  • Save the file name as C File (.c) instead of C++ File (.cpp). 
  • Write code and Click F5 (or Green Play button) to start debugging. 
  • Here you get the output. Hurray!!! 

No comments:

Post a Comment