Int to Double Cast in C

Level 126 keystrokes

Casts the integer 5 to a double and outputs it.

C code

// (double) casts a value to double-precision floating point
// %f prints a double with 6 digits after the point by default: 5.000000
1printf("%f\n", (double)5);

Output

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

  • "× 2
  • (× 2
  • )× 2
  • ,× 1
  • ;× 1
  • \× 1
  • %× 1

More C examples at level 1

← C typing practice