Log in from a computer to take this course

You'll need to log in from a computer to start Learn C++. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store
Learn

High five! We just got your first program to run.

C++, like most programming languages, runs line by line, from top to bottom. Here is the structure of a C++ program:

Program Structure

In between the curly braces is what we are going to focus on for now.

std::cout << "Hello World!\n";
  • std::cout is the “character output stream”. It is pronounced “see-out”.
  • << is an operator that comes right after it.
  • "Hello World!\n" is what’s being outputted here. You need double quotes around text. The \n is a special character that indicates a new line.
  • ; is a punctuation that tells the computer that you are at the end of a statement. It is similar to a period in a sentence.

Instructions

1.

Let’s write the whole std::cout statement from scratch.

Inside the curly braces, type the following and press Run:

std::cout << "Codecademy\n";

What do you think this program will output?

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?