Functions and Parameters
Multiple Calls
Call the same helper with different values.
Multiple Calls
MultipleCalls.kt
fun addFee(amount: Int): Int {
return amount + 2
}
fun main() {
val first =
val small = addFee(first)
val large = addFee(10)
val difference = large - small
println("small=$small")
println("difference=$difference")
}
fun addFee(amount: Int): Int {
return amount + 2
}
fun main() {
val first =
val small = addFee(first)
val large = addFee(10)
val difference = large - small
println("small=$small")
println("difference=$difference")
}
fun addFee(amount: Int): Int {
return amount + 2
}
fun main() {
val first =
val small = addFee(first)
val large = addFee(10)
val difference = large - small
println("small=$small")
println("difference=$difference")
}
calls
A function can be called more than once with different arguments.