From 6c04b75271943ba5236215685c66a6bef29442c4 Mon Sep 17 00:00:00 2001 From: Bassem Girgis Date: Fri, 16 Jul 2021 20:50:34 -0500 Subject: [PATCH] 2nd step --- src/main.rs | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9221144..bf07fcf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,38 @@ +fn print_type_of(_: &T) { + println!("{}", std::any::type_name::()) +} + 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("ient); + + // remainder + let remainder = 43 % 5; + print_type_of(&remainder); }