Introduction to C · Lesson 1 of 35
What Is C Programming?
C is a general-purpose programming language created by Dennis Ritchie at Bell Labs in 1972 to write the UNIX operating system. More than fifty years later it still runs the world: the Linux and Windows kernels, the Python interpreter, MySQL, SQLite, Git, your router's firmware and the chips in your car are all written largely in C. Learning C teaches you how computers really work – memory, pointers, compilation – which makes every other language easier.
In this lesson
- Where C is used today
- The features that make C special
- A first look at a C program
- C versions, and C vs C++, Java and Python
Where C is used
C is the foundation layer of computing
C
- Operating systemsLinux, Windows and macOS kernels, device drivers
- Embedded systemsmicrocontrollers, IoT devices, cars, medical devices
- DatabasesMySQL, PostgreSQL, SQLite, Redis
- Language runtimesCPython, PHP, Ruby, parts of the JVM and Node.js
- Tools and networkingGit, curl, Nginx, compilers
- Performance-critical codegame engines, graphics, scientific computing
Why C is special
| Feature | What it means |
|---|---|
| Fast | compiled straight to machine code; very little runs "behind your back" |
| Close to the hardware | pointers give direct access to memory addresses |
| Small and simple | about 32 keywords in classic C; the whole language fits in a short book |
| Portable | the same source compiles for phones, PCs, servers and tiny chips |
| Procedural and structured | programs are built from functions |
| Manual memory management | you allocate and free memory yourself – powerful, but it's your responsibility |
A first look
#include <stdio.h>
int main(void) {
int marks[] = {78, 91, 85};
int total = 0;
for (int i = 0; i < 3; i++) {
total += marks[i];
}
printf("Total: %d\n", total);
printf("Average: %.1f\n", total / 3.0);
return 0;
}
Total: 254 Average: 84.7
Even this short program shows C's character: you declare the type of every variable (int), you say exactly how to format output (%d, %.1f), and the program starts at a function called main. The next lesson explains every line.
Versions of C
| Standard | Year | Notable additions |
|---|---|---|
| K&R C | 1978 | the original, from Kernighan and Ritchie's book |
| C89/C90 (ANSI C) | 1989 | the first standard – what older textbooks teach |
| C99 | 1999 | // comments, declarations anywhere, bool, long long, variable-length arrays |
| C11 / C17 | 2011 / 2018 | threads, atomics, _Static_assert, bug fixes – this course uses C17 |
| C23 | 2024 | true/false/nullptr keywords, typeof, binary literals |
C compared with other languages
| C | C++ | Java | Python | |
|---|---|---|---|---|
| Paradigm | procedural | procedural + OOP | OOP | multi-paradigm |
| Runs as | native machine code | native machine code | bytecode on the JVM | interpreted |
| Memory | manual (malloc/free) | manual + RAII | garbage collected | garbage collected |
| Pointers | yes | yes | no (references) | no |
Why colleges start with C
C hides very little. When you learn how arrays sit in memory, how a function call uses the stack and why a pointer can crash a program, you understand what Java, Python and JavaScript do for you automatically – and you can reason about performance and bugs in any language.
Practice
Quick check
Who created C, and for what?
Dennis Ritchie at Bell Labs, around 1972, to write the UNIX operating system.
Is C compiled or interpreted?
Compiled – source code is translated into machine code before it runs.
Name two widely used programs written in C.
For example the Linux kernel, Git, SQLite, MySQL or the CPython interpreter.
Summary
- C is a fast, small, portable, compiled language from 1972 that still powers operating systems and devices.
- It gives direct control of memory through pointers and manual allocation.
- This course teaches modern C17, compiled with GCC or Clang.
Finished this lesson?
Mark it complete to track your progress, then carry on with the next lesson.