To multiply two numbers in Rust, 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
.fn main() {
let num1 = 5;
let num2 = 10;
let product = num1 * num2;
println!("Product of {} and {} is: {}", num1, num2, product);
}
Product of 5 and 10 is: 50
In this tutorial, we learned How to Multiply Two Numbers in Rust language with well detailed examples.