String Chaining in C++

Level 136 keystrokes

Chains two << operations to print "Hello" and " World" as one line.

C++ code

// Each << returns the stream, so several outputs can be chained in one statement
// The strings are printed back to back; the space comes from " World" itself
1cout << "Hello" << " World" << endl;

Output

Hello World
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this C++ code and how often they appear.

  • <× 6
  • "× 4
  • ;× 1

More C++ examples at level 1

← C++ typing practice