C Introduction
C is a general purpose programming language. It was created by Dennis Ritchie at Bell Labs in the early 1970s, to write the UNIX operating system. More than 50 years later it is still one of the most used languages in the world.
Many other languages like C++, Java, C#, PHP and JavaScript took their syntax from C. So when you learn C first, learning the next language becomes much easier.
Why learn C?
- C is close to the hardware, so you understand how memory, variables and pointers really work.
- It is fast. Programs written in C run with very little overhead.
- It is small. The language has only a few keywords, so you can learn the full basics in a few weeks.
- It builds a strong base for data structures, algorithms and system programming.
Where is C used?
- Operating systems like Linux, Windows kernel parts and macOS parts.
- Embedded systems, like the software inside a washing machine, a car or a smart watch.
- Databases (MySQL and many others are written in C or C++), compilers and interpreters.
- Games engines and device drivers.
Your first look at a C program
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
return 0;
}
Output:
Output of the above program is
Hello, World!
Do not worry if you do not understand every line. We will go through each part in the next chapters.
What you will learn in this tutorial
- Basics: variables, data types, operators, input and output.
- Decision making and loops.
- Functions, arrays and strings.
- Pointers, structures, file handling and more.
Note:
Practice is the key. Type every example yourself, run it and then change the values to see what happens.
Next: C Features.
Congratulations! Chapter Finished. Learn more about the similar topics:
| Exercises & Assignments |
|---|
| No Content Found. |