Learn C by Watching Your Code Run.
Step through real C programs one line at a time and see what really happens: variables appear in memory, values change, output fills the console.
- Learnthe idea
- Readthe program
- Runline by line
- Watchmemory & output
- Changethe values
- Practicetest yourself
- Assessprove it
39 modules in 10 parts — from your very first program to files
Pass each module's quiz (70% or more), then take the final exam to earn your certificate.
- Part 1 Getting started
-
Module 1
Introduction to C
What C is, the parts of every C program, and how your code becomes a program that runs.
- History of C
- Structure of a program
- main() and printf()
- Compile & run
- Escape sequences
-
Module 2
Setting Up: Write, Compile & Run
Install a C compiler, write a program in an editor, compile it with gcc, run it, and read error messages.
- Installing GCC
- Editors & IDEs
- Online compilers
- gcc commands
- Errors vs warnings
- Edit → compile → run
-
Module 3
Building Blocks of C
The pieces every C program is made of: tokens, keywords, identifiers, literals, comments and statements.
- Character set
- Tokens
- The 32 keywords
- Identifiers & naming rules
- Comments & whitespace
- Statements & blocks
- Part 2 Data
-
Module 4
How Computers Store Data
Bits and bytes, binary, octal and hexadecimal, characters as numbers, negative numbers and decimals.
- Bits & bytes
- Binary ↔ decimal
- Octal & hexadecimal
- ASCII codes
- Two's complement
- Why decimals are approximate
-
Module 5
Variables & Data Types
Store values in memory: int, float, double and char — their sizes, ranges and conversions.
- Variables
- int, float, double, char
- Sizes in memory
- Overflow
- Integer division
- const
-
Module 6
Constants & Literals
Every way to write a fixed value in C: number bases, suffixes, characters, escape sequences and strings.
- Integer literals (dec / oct / hex)
- Suffixes U, L, LL, f
- Character literals
- All escape sequences
- String literals
- const vs #define
-
Module 7
Output with printf
Print anything exactly the way you want: format specifiers, width, precision and flags.
- Format specifiers
- Field width
- Precision
- Flags - + 0 space
- Printing % and quotes
- puts & putchar
-
Module 8
Input with scanf
Read values from the keyboard safely: format strings, the & sign, several values and common traps.
- scanf basics
- Why &
- Reading several values
- The leftover newline
- Return value of scanf
- getchar
- Part 3 Operators & expressions
-
Module 9
Arithmetic & Assignment Operators
Calculate with + - * / %, change variables with = and += …, and count with ++ and --.
- + - * / %
- Unary minus
- Assignment =
- Compound assignment += -= …
- ++ and -- (prefix vs postfix)
-
Module 10
Relational & Logical Operators
Compare values and combine conditions — and how C represents true and false.
- < > <= >= == !=
- True = 1, false = 0
- = vs ==
- && || !
- Short-circuit evaluation
-
Module 11
Bitwise Operators
Work with the individual bits of a number: AND, OR, XOR, NOT and shifts.
- & | ^ ~
- << and >>
- Masks
- Set, clear, toggle, test a bit
- Shifts as × and ÷ by 2
-
Module 12
Precedence, Associativity & Conversions
How C decides what to calculate first, and how values change type inside expressions.
- Precedence table
- Associativity
- Implicit conversions
- Casts
- sizeof
- The ?: and comma operators
- Part 4 Decisions
-
Module 13
if and if-else
Make your program choose: run some statements only when a condition is true.
- if
- if-else
- Conditions
- Blocks { }
- Common mistakes
-
Module 14
else-if Ladder & Nested if
Choose between many options, and put decisions inside decisions.
- else-if ladder
- Order of conditions
- Nested if
- Dangling else
- Logical operators in conditions
-
Module 15
switch Statement
Pick one of many cases by value — with break, fall-through and default.
- switch & case
- break
- Fall-through
- default
- switch vs else-if
- Part 5 Loops
-
Module 16
while Loop
Repeat statements as long as a condition is true — and how to avoid endless loops.
- Condition, body, update
- Counting loops
- Sentinel loops
- Infinite loops
- Tracing a loop
-
Module 17
for Loop
The compact counting loop: start, condition and step in one line.
- Start; condition; step
- Counting up and down
- Sum & product
- Loop variable scope
- for vs while
-
Module 18
do-while Loop
The loop that always runs at least once — ideal for menus and input checks.
- do { } while ();
- Runs at least once
- Menus
- Input validation
- Choosing the right loop
-
Module 19
break, continue & Nested Loops
Leave or skip part of a loop, and put loops inside loops to draw patterns.
- break
- continue
- Nested loops
- Star & number patterns
- goto (and why to avoid it)
-
Module 20
Problem Solving with Loops
Classic beginner programs, built step by step: digits, primes, GCD, Fibonacci and more.
- Sum & reverse of digits
- Palindrome & Armstrong numbers
- Prime numbers
- GCD & LCM
- Factorial & Fibonacci
- Part 6 Functions
-
Module 21
Functions: The Basics
Split a program into named, reusable pieces: declare, define and call your own functions.
- Why functions
- Prototype (declaration)
- Definition
- Calling a function
- return & void
- Library functions
-
Module 22
Parameters & Return Values
Send values into a function and get a result back — and what really happens on the call stack.
- Parameters vs arguments
- Pass by value
- Several parameters
- Returning a value
- The call stack
-
Module 23
Scope, Lifetime & Storage Classes
Where a variable can be used, how long it lives, and what auto, static, extern and register mean.
- Local & global variables
- Block scope & shadowing
- Lifetime
- static variables
- extern & register
-
Module 24
Recursion
Functions that call themselves: base case, recursive case and the stack growing and shrinking.
- Base case
- Recursive case
- Factorial & power
- Fibonacci
- Tower of Hanoi
- Recursion vs loops
- Part 7 Arrays & strings
-
Module 25
Arrays
Many values of the same type side by side in memory, reached by an index.
- Declare & initialise
- Index from 0
- Out-of-bounds
- Traversal
- Sum, max & min
- Linear search & reverse
-
Module 26
2-D Arrays & Arrays in Functions
Tables of values (rows and columns), and passing arrays to functions.
- Passing arrays to functions
- 2-D arrays
- Row-major memory
- Matrix addition
- Matrix multiplication & transpose
-
Module 27
Strings
Text in C: arrays of characters that end with '\0' — reading, printing and walking through them.
- char arrays
- The '\0' terminator
- String literals
- Reading text (scanf, fgets)
- Looping through a string
-
Module 28
String & Character Functions
The ready-made helpers in string.h and ctype.h — and how to write them yourself.
- strlen, strcpy, strcat
- strcmp
- strncpy & safe copying
- ctype.h (isdigit, toupper …)
- Writing your own
- Part 8 Pointers
-
Module 29
Pointer Basics
Variables that hold addresses: & and *, NULL, and what a pointer looks like in memory.
- Addresses
- & (address-of)
- * (dereference)
- Declaring pointers
- NULL
- Pointer sizes
-
Module 30
Pointers & Functions
Let a function change your variables: call by reference, swap and several results.
- Call by value vs by reference
- swap()
- Returning several results
- Pointer parameters
- Common mistakes
-
Module 31
Pointers & Arrays
Why an array name acts like a pointer, pointer arithmetic, and pointers to strings.
- Array name as pointer
- Pointer arithmetic
- p[i] and *(p + i)
- Pointers & strings
- Walking an array with a pointer
-
Module 32
More Pointers
Pointers to pointers, arrays of pointers, function pointers and const with pointers.
- Pointer to pointer
- Arrays of pointers
- Arrays of strings
- Function pointers
- const and pointers
- void pointers
-
Module 33
Dynamic Memory
Ask for memory while the program runs: malloc, calloc, realloc and free — without leaks.
- Stack vs heap
- malloc & free
- calloc
- realloc
- Memory leaks
- Dangling pointers
- Part 9 Your own types
-
Module 34
Structures
Group related values of different types into one record: struct, members and arrays of structures.
- Defining a struct
- Members & the . operator
- Initialising
- Arrays of structures
- Nested structures
- Size & padding
-
Module 35
Structures, Pointers & Functions
Pass structures to functions, point to them with ->, and give types short names with typedef.
- Pointer to a struct
- The -> operator
- Structures & functions
- typedef
- Self-referencing structures
-
Module 36
Unions & Enums
Unions share one piece of memory between members; enums give names to whole numbers.
- union
- Union vs struct size
- When to use a union
- enum
- enum values & switch
- Part 10 Files & more
-
Module 37
File Handling Basics
Save data to text files and read it back: fopen, fclose, fprintf, fscanf, fgets and EOF.
- FILE *
- fopen modes
- fclose
- fprintf & fscanf
- fgetc, fputc, fgets, fputs
- EOF & errors
-
Module 38
More File Handling
Binary files, moving around inside a file, appending and handling errors properly.
- Text vs binary files
- fread & fwrite
- fseek, ftell, rewind
- Append mode
- Error handling
- Copying a file
-
Module 39
Preprocessor & Command-Line Arguments
What happens before compiling — #include, macros, conditional compilation — and argc / argv.
- #include
- #define & macros
- Macro pitfalls
- Conditional compilation
- Header files
- argc & argv