Size of Double in C++

Level 131 keystrokes

Prints the size of the double type in bytes, which is 8 on common platforms.

C++ code

// sizeof(double) gives the size of the double type in bytes
// On common platforms double is a 64-bit IEEE 754 number, so it takes 8 bytes
1cout << sizeof(double) << endl;

Output

8
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
  • )× 1

More C++ examples at level 1

← C++ typing practice