Apply for Zend Framework Certification Training

c



< Introduction to C Programming-2 Compile a C file using its filename >



Install Visual Studio Code
Go to  https://code.visualstudio.com
Click Download for Windows
Run the installer
Keep default options checked
? Add to PATH
? Add “Open with Code”
Click Install → Finish
2 Install C Compiler (MinGW – GCC)
Step A: Download MinGW
Visit https://sourceforge.net/projects/mingw/
Download mingw-get-setup.exe
Run the installer
Step B: Select Packages
Open MinGW Installation Manager
Mark these packages:
? mingw32-gcc-g++
? mingw32-gcc-core
? mingw32-base
Click Installation → Apply Changes
3 Set Environment Variable (IMPORTANT)
Open This PC → Properties
Click Advanced system settings
Click Environment Variables
Under System Variables, select Path
Click Edit → New
Add:
C:\MinGW\bin

Click OK → OK
Restart your computer

4 Verify C Compiler Installation
Open Command Prompt
Type:
gcc --version
If version appears → C is installed correctly
5 Install C Extension in VS Code
Open VS Code
Press Ctrl + Shift + X
Search C/C++
Install C/C++ (by Microsoft)
6 Write Your First C Program
Create a folder (e.g., C_Programs)
Open it in VS Code
Create file → hello.c
Write:
#include <stdio.h>
int main() {
    printf("Hello World");
    return 0;
}
7 Compile & Run C Program
Open Terminal
Press Ctrl + `
Compile
gcc hello.c -o hello
Run
hello
Output:
Hello World
Installation Complete!
You can now write, compile, and run C programs in VS Code.

< Introduction to C Programming-2 Compile a C file using its filename >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top