Complete the quotient and remainder calculation code and print a message according to the following template:
The quotient is: {val1} and the remainder is: {val2}.
In this template, {val1} should be replaced by the quotient value and {val2} should be replaced by the remainder value.
Euclidean division
Using parentheses in your code
Report a typo
Sample Input 1:
14
3Sample Output 1:
The quotient is: 4 and the remainder is: 2Write a program in Kotlin
fun main() {
val dividend: Int = readln().toInt()
val divisor: Int = readln().toInt()
val quotient: Int = dividend.floorDiv()
val remainder: Int = dividend.mod()
print()
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.