Kotlin Program to Compute Quotient and Remainder: In the above program Kotlin Program to Compute Quotient and Remainder, two numbers 25 (dividend) and 4 (divisor) are stored in the dividend and division numbers respectively. Unlike Java, they are automatically assigned type Int in Kotlin.
Kotlin Program to Compute Quotient and Remainder
Source Code
fun main(args: Array<String>) {
val dividend = 25
val divisor = 4
val quotient = dividend / divisor
val remainder = dividend % divisor
println("Quotient = $quotient")
println("Remainder = $remainder")
}
Output
Kotlin Program to Compute Quotient and Remainder