Division in C++

Level 123 keystrokes

Prints 15 divided by 3, which is 5.

C++ code

// Both operands are int, so / performs integer division
// 15 / 3 divides evenly, so the result is exactly 5
1cout << 15 / 3 << endl;

Output

5
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