Caffeinated Coder
Book an appointment
Lesson 02 · Basics

Your first program

Write, build and run a ten-line C++ program that asks for your name and greets you. Watch it run one line at a time: a variable is made as an empty box in memory, std::cout puts a question on the screen, std::cin reads your answer into the box, and << chains text and the box's value into a greeting. Then see why typing a full name only greets your first name.

10 min9 steps5 questionsBeginner
Fig 2 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.