Subtraction in C++

Level 123 keystrokes

Prints the difference 10 - 4, which is 6.

C++ code

// The - operator subtracts the right operand from the left one
// 10 - 4 is calculated before output, so cout prints 6
1cout << 10 - 4 << endl;

Output

6
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