Learn

Learn

This is a demo of how to use Install C.

Step 1: Download and Install installc.exe.

Step 2: Open Command Prompt from the Start Menu and type in gcc --version.

Step 3: If it says

Command Prompt

gcc (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

then congratulations, C has been installed sucessfully on your system. Read on to learn how to write your first program in C.

Hello, World!

Let’s see how to code ‘Hello, World!’ with C.

Step 1: Open Notepad and type in the following code:

hello.c
#include <stdio.h>

int main() {
    printf("Hello, World!");
    return 0;
}

Save the file as hello.c.

Step 2: Open Command Prompt, navigate to where hello.c is stored, and type in the following command to compile your program into an executable:

Command Prompt


gcc hello.c -o hello.exe

And then to run your program simply type:

Command Prompt


hello.exe

Congratulations, you just wrote your first program in C.