Loading . . .

C Programming in VS Code

Printing a message in C

Beginner's Guide to Keywords, Identifiers, Constants, Variables, Datatypes in C

Operators & Expressions in C

Input & Output Operations in C

Control Statements in C

Loops in C

Array in C

Character Array & Strings in C

User Defined Functions in C

Structure and Union in C

Pointers in C


Disclaimer: Educational Purposes Only

The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.

The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.

Download Notes

C Programming in VS Code

Steps:

1) Download and install VS Code.

2) Install C/C++ extension in VS Code.

3) Install Code Runner extension in VS Code.

4) Download and install MinGW Compiler.

5) Check the mingw32-gcc-g++ package when finishing the installation of the MinGW Compiler.

6) Set the path of MinGW Compiler in the environment variable (PATH).

7) Go to the settings page of VS Code, and under extensions, go to Code Runner Extension and check the Run in Terminal option.

8) The above step is required to ensure that the terminal can accept input from the user when the program needs it.

9) Now, write the C program and right on the blank space of the file and select Run Code to execute the program and output of the program will be shown in VS Code terminal.

Links:

C Programming in VS Code

First Program in VS Code:

first_program.c


#include <stdio.h>

void main() 
{
    printf("First Program in VS Code");
}

Second Program in VS Code:

second_program.c


#include <stdio.h>

void main() 
{
    int x;
    printf("Enter a number: ");
    scanf("%d", &x);
    printf("\nYou entered: %d", x);
}