Floating Point in C++

Level 121 keystrokes

Prints the floating-point literal 3.14.

C++ code

// A literal with a decimal point, like 3.14, has type double
// cout prints up to 6 significant digits by default, so it shows 3.14
1cout << 3.14 << endl;

Output

3.14
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
  • .× 1

More C++ examples at level 1

← C++ typing practice