Integer Output in C++

Level 119 keystrokes

Prints the integer 42 with cout.

C++ code

// Numbers are written without quotes: 42 is an int literal
// cout converts the value to the text 42 and endl ends the line
1cout << 42 << endl;

Output

42
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.

  • <× 4
  • ;× 1

More C++ examples at level 1

← C++ typing practice