Mixed Output in C++

Level 130 keystrokes

Prints the string "Age: " followed by the number 20 in one statement.

C++ code

// One chain of << can mix types: first the string "Age: " is printed
// then the int 20 is converted to text and printed right after it
1cout << "Age: " << 20 << endl;

Output

Age: 20
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
  • "× 2
  • ;× 1
  • :× 1

More C++ examples at level 1

← C++ typing practice