C++ Programming
Learn C++ from cout to classes, references and the STL. Examples run in your browser, so you can experiment freely.
- 5 modules
- 20 lessons
- 88 runnable examples
- Beginner to advanced
Getting started
Input, output and variables.
Control flow
Decisions and loops.
Functions
Reusable code.
Object-oriented C++
Classes and inheritance.
The Standard Library
Strings, vectors and maps.
Add two numbersRead two integers with cin and print the sum. SolvedEasy+30 XPLetter gradeTurn a score into A, B, C or F. SolvedEasy+30 XPTimes tablePrint n x 1 to n x 10. SolvedEasy+30 XPSum of digitsAdd up the digits of a number. SolvedMedium+50 XPMinimum and maximumFind the smallest and largest of n numbers. SolvedMedium+50 XPFizzBuzzThe classic, in C++. SolvedEasy+30 XP
C++ quiz
Ten questions drawn at random from 52, 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.