Arithmetic operations
Arithmetic operators are used to perform basic mathematical operations.
+
: Addition
-
: Subtraction
*
: Multiplication
/
: Division
%
: Remainder (modulus)
fn main() { let a = 10; let b = 3; println!("a + b = {}", a + b); // Addition println!("a - b = {}", a - b); // Subtraction println!("a * b = {}", a * b); // Multiplication println!("a / b = {}", a / b); // Division println!("a % b = {}", a % b); // Remainder }