Skip to content

Instantly share code, notes, and snippets.

View mikastudhhn's full-sized avatar

Mika mikastudhhn

  • Hochschule Heilbronn
  • Heilbronn
  • 03:09 (UTC +01:00)
View GitHub Profile
fun calculate(a: Int, b: Int, operation: String): Int {
return when (operation) {
"+" -> a + b
"-" -> a - b
"*" -> a * b
"/" -> {
if (b != 0) {
a / b
} else {