To multiply two numbers in Kotlin, you can use the '*' operator.
In this example,
num1
and num2
and assign them the numbers to be multiplied.*
operator and store the result in a variable product
.product
.fun main(args: Array<String>) {
val num1 = 5;
val num2 = 10;
val product = num1 * num2;
println("Product of $num1 and $num2 is: $product");
}
Product of 5 and 10 is: 50
In this tutorial, we learned How to Multiply Two Numbers in Kotlin language with well detailed examples.