Lessons
Setup guides, then Chapter 1 exercises from Kernighan and Ritchie's The C Programming Language (Second Edition). Read why we teach from K&R.

01
beginner
Why learn the basics of coding?
AI and copy-paste can ship a demo. Fundamentals are what let you debug it, change it, and invent the program you actually meant.

02
beginner
Solid foundation in the command line
I thought Terminal was only for sysadmins — then C forced me to learn it. Open it, see the file tree, and walk around with pwd, ls, and cd.

03
beginner
Command line: files and folders
Make a sandbox first, then practise mkdir, cp, mv, and rm so a mistake cannot touch the files you care about.

04
beginner
Getting your macOS ready for C
Skip full Xcode. Install Apple’s Command Line Tools so Clang is ready in Terminal — then you can compile C on your Mac.

05
beginner
Installing the CS50 library
Put cs50.h on your Mac so helpers like get_string() work with Clang — install from source, fix the paths, optionally wire a Makefile.

K&R · The textbook
beginner
Why we teach from K&R
The exercises on getc.uk come from Kernighan and Ritchie’s The C Programming Language, Second Edition — the short ANSI C textbook that teaches how the machine actually works.
- Ch 1
Ch 1
beginner
Chapter 1: A Tutorial Introduction
Hello, world, tables, characters, and the first programs that talk to the machine.

Ex 1-1
beginner
Hello, world
K&R Exercise 1-1: write hello, world, compile it, then break pieces off and read what the compiler says.

Ex 1-2
beginner
Unknown escape sequences
K&R Exercise 1-2: put a fake escape like \c inside printf, compile it, and read the warning — then run the program and see what printed.

Ex 1-3
beginner
Fahrenheit to Celsius table
K&R Exercise 1-3: print a Fahrenheit–Celsius table from 0 to 300, then add a heading so the columns have names.

Ex 1-4
beginner
Celsius to Fahrenheit table
K&R Exercise 1-4: invert the temperature table — Celsius on the left, Fahrenheit on the right — using the same loop with the formula flipped.

Ex 1-5
beginner
Reverse temperature table
K&R Exercise 1-5: reprint the Fahrenheit–Celsius table from 300 down to 0, using a for loop that counts backwards.

Ex 1-6
beginner
getchar() and EOF
K&R Exercise 1-6: prove that getchar() != EOF is only 0 or 1 — type a character for 1, send end-of-file for 0.

Ex 1-7
beginner
The value of EOF
K&R Exercise 1-7: print the numeric value of EOF — a one-line program that asks stdio.h what that macro actually is.

Ex 1-8
beginner
Count blanks, tabs, and newlines
K&R Exercise 1-8: read input with getchar until EOF and count spaces, tabs, and newlines as three separate totals.

Ex 1-9
beginner
Collapse runs of blanks
K&R Exercise 1-9: copy input to output, replacing each run of one or more blanks with a single blank.

Ex 1-10
beginner
Make escapes visible
K&R Exercise 1-10: copy input to output, replacing each tab, backspace, and backslash with a visible escape sequence.

Ex 1-11
intermediate
Test the word count program
K&R Exercise 1-11: compile the word-count program, then try empty input, whitespace-only files, missing newlines, and punctuation to see which cases uncover bugs.