diff --git a/assignments/assignment_2.md b/assignments/assignment_2.md index e69de29..547844e 100644 --- a/assignments/assignment_2.md +++ b/assignments/assignment_2.md @@ -0,0 +1,44 @@ +fn main() { + + add(); + subtraction(); + multiply(); + division(); + +} + + +pub fn add() -> u8 { + let x: u8 = 24; + let y: u8 = 40; + let z: u8 = x + y; + println!("The value of Z is: {}", z); + z +} + + +pub fn subtraction() -> u128 { + let x: u128 = 404; + let y: u128 = 40; + let z: u128 = x - y; + println!("The value of Z is: {}", z); + z +} + + +pub fn multiply() -> u128 { + let x: u128 = 50; + let y: u128 = 40; + let z: u128 = x * y; + println!("The value of Z is: {}", z); + z +} + + +pub fn division() -> u8 { + let x: u8 = 400; + let y: u8 = 40; + let z: u8 = x / y; + println!("The value of Z is: {}", z); + z +}