Lesson 1 of 24

Your First C++ Program

7 min 20 XP

C++ builds on C with classes and the STL while keeping C's speed: games, browsers, trading systems and competitive programming all use it. cout << prints to the screen; endl or "\n" ends the line.

Example: edit me and press Run

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.

using namespace std; lets you write cout instead of std::cout. In large projects, writing std:: explicitly is considered better style.

Challenge

+20 XP

Print these two lines exactly: Hello C++ I can code!

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.