We need an environment setup for writing and compiling the C program. For this we need two tools:

  1. Text editor
  2. C compiler

Text editor

For writing a C program we need a text editor. You can easily get the text editors like Notepad, Notepad++, Atom, Visual Studio Code, Vim and more. You need to install it if you don’t have one.

C compiler

The program written using the text editor is in human understandable form but the machine or CPU can only understand the machine code, so in order to convert it into the machine understandable form we need a tool known as Compiler. Therefore a compiler is a software that converts high level language into machine code or executable programs.
There are many C compilers available. The mostly used and freely available C compiler is GNU C/C++ (GNU gcc) compiler. You need to install the C compiler in order to compile the C source code. In most cases macOS and UNIX/Linux has an inbuilt C compiler.
You can check whether GCC is installed on your system by typing the following command in the terminal.

$ gcc -v

And you will get following output if it is installed. If not then you need to install it.

gcc

For windows OS you need to install MinGW.