Negative Number in C++

Level 120 keystrokes

Prints the negative integer -25.

C++ code

// -25 is the unary minus operator applied to the literal 25
// cout prints negative numbers with a leading minus sign
1cout << -25 << endl;

Output

-25
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