Download and install: Download VS Code

Shortcut to open:

Windows Key → Type “VS Code” → Enter

VS Code Run C and C

Download and install: MinGW

Step 1: Download MinGW

Shortcut: Ctrl + L → Type → Enter

Step 2: Run Installer

Ctrl + J → Open Downloads

Double-click installer

Step 3: Select Packages

Select:

Step 4: Apply Changes

Step 5: Set PATH

Windows + S → Search “Environment Variables”

Steps:

Step 6: Verify Installation

Windows + R → cmd → Enter

Run:

Important

Compiler

Language

gcc

C

g++

C++

Open Extensions:

Ctrl + Shift + X

Install:

Open Folder:

Ctrl + K, Ctrl + O

New File:

Ctrl + N

Save:

Ctrl + S

File names:

main.c

#include <stdio.h>

int main() {
    printf("Hello from C");
    return 0;
}

main.cpp

#include <iostream>
using namespace std;

int main() {
    cout << "Hello from C++";
    return 0;
}

Open Terminal:

C:

C++:

Run:

Stop:

Output Panel (Clean Output)

View Output:

Terminal Mode (For Input)

Mode

 Use

OUTPUT

Simple programs

TERMINAL

 Input programs

Command Palette: Ctrl + Shift + P

Type: Tasks: Configure Task

Select: C/C++: g++.exe build active file

Build: Ctrl + Shift + B

VS Code Run C and C steps

Leave a Reply

Your email address will not be published. Required fields are marked *