To find the subtraction of numbers in Rust, you can use the '-' operator.
In this example,
num1
and num2
.num2
from num1
using the -
operator and assign the result to a variable result
.result
.fn main() {
let num1 = 20;
let num2 = 10;
let result = num1 - num2;
println!("Subtraction of {} and {} is: {}", num1, num2, result);
}
Subtraction of 20 and 10 is: 10
In this tutorial, we learned How to find the Subtraction of Two Numbers in Rust language with well detailed examples.