programming language is perhaps the most popular programming language. C was created in 1972 by Dennis Ritchie at the Bell Labs in USA as a part of UNIX operating system. C was also used to develop some parts of this operating system. From that time C programming language has been the defacto programming language when fast programs are needed or the software needs to interact with the hardware in some way.
Most of the operating systems like Linux, Windows™, and Mac™ are either developed in C language or use this language for most parts of the operating system and the tools coming with it.
This course is a quick course on C Programming language. In our first lesson we will first write our first C program. We will then learn about printing to screen, variables and functions. We assume that you are familiar with at least one of the popular operating systems.
For this course you can use the following compilers or Programming Environments.
- • Gcc and cc in Unix and Linux operating systems
- • Borland C or Turbo C in DOS operating system or in Command line environment of windows operating system
- • “Bloodshed Dev-Cpp” integrated development environment (IDE) gives you a complete and
- compact programming environment. It comes with “MinGW” and “GCC” C Compilers and
- you should not need anything else for this course.
We use “Bloodshed Dev-Cpp” for this course and we suggest you also use it. “Bloodshed Dev-Cpp” is
free and it can be downloaded from the website http://www.bloodshed.net (currently under the URL
Your first C program
Let’s write our first C program.
Example 1-1: example1-1.c
system(“pause”); //this line is only needed under windows
First step for running this program is to make a text file containing above code. Be sure that the file is a pure text file. You must save the text file with c extension.
Then you must compile the source code. The result of compile step is an executable file that you can
If you are running your example on Unix/Linux type operating systems you can remove the line which
is commented to be necessary just under Windows.