Division in Kotlin

Level 115 keystrokes

Prints the result of dividing 20 by 4. Both operands are Int, so this is integer division.

Kotlin code

// Int / Int is integer division (drops any fraction); 20 / 4 gives 5
1println(20 / 4)

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 Kotlin code and how often they appear.

  • (× 1
  • )× 1
  • /× 1

More Kotlin examples at level 1

← Kotlin typing practice