C Get Started
Before we begin writing C code, we first need to install a C compiler. A compiler is an application that translates your code into machine language that can be understood by a computer. There are many compilers to use with C programming, however, in this lesson we will utilize the Dev C++ compiler.
Installing Dev-C++
- Open your web browser and navigate to the Dev-C++ download page on SourceForge https://sourceforge.net/projects/orwelldevcpp/
- Click on the green "Download" button to begin downloading the installer file.
- After the download is finished, find the downloaded file and double-click on it to initiate the installation process.
- On the initial screen of the installation wizard, press the "Next" button to continue.
- Carefully read the license agreement, and if you accept the terms, choose the "I accept the agreement" radio button and click on "Next".
- Select the location for installation and click "Next.".
- Click on "Install" to proceed with the installation.
- After the installation is finished, click on "Finish" to shut down the installation wizard.
Here is a video reference for clearer understanding
First C Program
After you have installed the compiler, you can now begin writing your first C program.
#include
<stdio.h>
int main()
{
printf("Hello Coders!");
return
0;
}
Save the program by going to "File" and then "Save As". Select a location on your computer to save the file, and
name it with the ".c" extension.
To run and compile the program, select "Execute" from the menu bar and then select "Compile & Run" from the
drop-down list. You will find the output "Hello, coders!" in the console window.