Learning track 1 · C Programming · start here

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.

  1. Learnthe idea
  2. Readthe program
  3. Runline by line
  4. Watchmemory & output
  5. Changethe values
  6. Practicetest yourself
  7. Assessprove it
Course Modules

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.

  1. Part 1 Getting started
  2. 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
  3. 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
  4. 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
  5. Part 2 Data
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. Part 3 Operators & expressions
  12. Module 9

    Arithmetic & Assignment Operators

    Calculate with + - * / %, change variables with = and += …, and count with ++ and --.

    • + - * / %
    • Unary minus
    • Assignment =
    • Compound assignment += -= …
    • ++ and -- (prefix vs postfix)
  13. 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
  14. 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
  15. 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
  16. Part 4 Decisions
  17. 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
  18. 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
  19. 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
  20. Part 5 Loops
  21. 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
  22. 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
  23. 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
  24. 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)
  25. 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
  26. Part 6 Functions
  27. 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
  28. 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
  29. 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
  30. 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
  31. Part 7 Arrays & strings
  32. 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
  33. 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
  34. 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
  35. 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
  36. Part 8 Pointers
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. Part 9 Your own types
  43. 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
  44. 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
  45. 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
  46. Part 10 Files & more
  47. 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
  48. 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
  49. 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