Scientific Notation in C++

Level 122 keystrokes

Prints the number written in scientific notation 1.5e2, which is 150.

C++ code

// e2 means "times 10 to the power of 2", so 1.5e2 is the double 150.0
// cout drops the trailing .0 by default, so it prints 150
1cout << 1.5e2 << endl;

Output

150
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