This commit is contained in:
2021-07-16 20:50:34 -05:00
parent 257b1e3b9e
commit 6c04b75271

View File

@@ -1,13 +1,38 @@
fn print_type_of<T>(_: &T) {
println!("{}", std::any::type_name::<T>())
}
fn main() {
// let mut x = 5;
// println!("The value of x is: {}", x);
// x = 6;
// println!("The value of x is: {}", x);
let x = 5;
let x = x + 1;
// let x = 5;
let x = x * 2;
// let x = x + 1;
println!("The value of x is: {}", x);
// let x = x * 2;
// println!("The value of x is: {}", x);
// addition
let sum = 5 + 10;
print_type_of(&sum);
// subtraction
let difference = 95.5 - 4.3;
print_type_of(&difference);
// multiplication
let product = 4 * 30;
print_type_of(&product);
// division
let quotient = 56.7 / 32.2;
print_type_of(&quotient);
// remainder
let remainder = 43 % 5;
print_type_of(&remainder);
}