C Programming
Learn C, the language under operating systems and embedded devices, from printf to pointers and structs. Examples run in your browser.
- 4 modules
- 15 lessons
- 71 runnable examples
- Beginner to intermediate
Getting started
Your first C program.
Control flow
Decisions and loops.
Functions and arrays
Structuring programs.
Memory
Pointers and structures.
Add two numbersRead two integers with scanf and print their sum. SolvedEasy+30 XPLargest of threePrint the biggest of three integers. SolvedEasy+30 XPFactorialCompute n! with a loop. SolvedEasy+30 XPReverse the digitsTurn 1234 into 4321 using % and /. SolvedMedium+50 XPCount the even numbersRead n numbers and count the even ones. SolvedMedium+50 XPPrimes up to nPrint every prime number up to n. SolvedHard+80 XP
C quiz
Ten questions drawn at random from 40, with an explanation after every answer. Score 70% to pass; a perfect round earns a badge.
- Treasure Quest
Sail across eight islands. Each one asks a question; lose three hearts and it's back to port.
- Speed Run
Sixty seconds on the clock. Every right answer scores, and a wrong one costs five seconds.
- Code Puzzle
Real code from the lessons, shuffled line by line. Put it back in the right order.