C Programming: Complete Step-by-Step Course

C Programming: a step-by-step course

29 lessons that take you from your first program to arrays, strings, functions and pointers. Each lesson explains one topic with worked examples. Follow them in order, or jump to any topic.

Start with Lesson 1 →

Part 1 · Getting Started

What C is, how a program is structured, and how to think in algorithms and flowcharts. (Lessons 1–5)

Part 2 · Data Types, Input/Output and Operators

Store data, read and print it, and combine values with operators. (Lessons 6–12)

6Data Types in C: Choosing the Right Box for Every Value
Back in the “Identifiers, Keywords and Variables” post, we compared a variable to a labeled storage box — and mentioned that every box can only hold one type of item. A…
7Formatted Input and Output in C: Taking Control of printf and scanf
You’ve already used printf() and scanf() throughout this course — but so far, only in their plainest form. Real programs rarely get to print numbers however they land: a…
8Practice Exercise Sheet: Data Types in C
Companion worksheet to “Data Types in C: Choosing the Right Box for Every Value” · Module I · Basics of C
9Operators and Expressions in C: Assignment, Unary, and Arithmetic
Every calculation a C program ever performs — computing a bill total, converting a temperature, working out simple interest — comes down to combining variables and…
10Relational, Logical, and Conditional Operators in C
Every decision a program ever makes — is this number bigger, is the user old enough, is a form completely filled in — depends on operators that answer true or false….
11Bitwise and Special Operators in C
Every value in C — no matter its type — is ultimately just a pattern of bits in memory, as the “Data Types in C” post explained. Most of the operators you’ve used so far…
12Operator Precedence and Associativity in C
Look at this line of C: 2 + 3 * 4. What is the answer? If you read left to right like a sentence, you get 5 * 4 = 20. But C says 14. Why? Because C has two sets of rules…

Part 3 · Decisions and Loops

Make choices and repeat work: if, switch, for, while, break, continue and goto. (Lessons 13–18)

Part 4 · Arrays

One-dimensional and two-dimensional arrays, and matrix operations. (Lessons 19–21)

Part 5 · Strings

Character arrays and collections of strings. (Lessons 22–23)

Part 6 · Functions and Scope

Split programs into functions and learn where variables live. (Lessons 24–28)

Part 7 · Pointers

Addresses, pointers and how to use them safely. (Lesson 29)