This challenge is about basic mathematical operations. You will be given 2 numbers a
and b
. You need to perform the following operations:
a
and b
a
and b
a
and b
a
and b
You need to return a tuple containing the results of the above operations in the same order. (sum, difference, multiply, divide)
Note that every value in the tuple must be of type
i32
.
In Rust you can use the following operators for the above operations:
+
-
*
/
Good luck!
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let difference = a - b; let multiply = a * b; let divide = a / b; return (sum, difference, multiply, divide) }
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) return ( a + b, a - b, a * b, a / b );}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) return (a+b,a-b,a*b,a/b);}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b) }
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a+b; let difference: i32 = a-b; let multiplication: i32 = a*b; let division: i32 = a/b; (sum, difference, multiplication, division)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let diff = a - b; let mult = a * b; let div = a/ b; (sum,diff,mult,div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { let sum: i32 = a + b; let diff: i32 = a - b; let mult: i32 = a * b; let div: i32 = a / b; (sum, diff, mult, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let difference = a - b; let multiply = a * b; let divide = a / b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) return (a+b ,a-b ,a*b ,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) return (a+b, a-b, a*b, a/b);}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a + b, a - b, a * b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let diff = a - b; let multi = a * b; let divi = a / b; (sum, diff, multi, divi)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) return (a + b, a - b, a * b, a / b);}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { (a + b, a - b, a * b, a / b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a +b; let difference = a - b; let multiply = a *b; let divide = a/b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a + b; let diff: i32 = a - b; let mul: i32 = a * b; let div: i32 = a / b; (sum, diff, mul, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let difference = a - b; let multiply = a * b; let divide = a / b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let dif = a - b; let mul = a * b; let dev = a / b; (sum, dif, mul, dev)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { let sum = a + b; let difference = a - b; let product = a * b; let quotient = a / b; (sum, difference, product, quotient)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a+b; let difference: i32 = a-b; let multiply: i32 = a*b; let divide: i32 = a/b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let diff = a - b ; let mult = a * b; let div = a / b; (sum, diff, mult, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a +b; let difference = a - b; let multiply = a *b; let divide = a/b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a + b; let diff: i32 = a - b; let mul: i32 = a * b; let div: i32 = a / b; (sum, diff, mul, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a + b; let diff: i32 = a - b; let mul: i32 = a * b; let div: i32 = a / b; (sum, diff, mul, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let diff = a - b; let mult = a * b; let div = a / b; (sum, diff, mult, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a + b; let diff: i32 = a - b; let mul: i32 = a * b; let div: i32 = a / b; (sum, diff, mul, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum =a+b; let difference =a-b; let multiply =a*b; let divide =a/b; (sum,difference,multiply,divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) return (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let difference = a - b; let multiply = a * b; let divide = a / b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let tup: (i32, i32, i32, i32) = (a+b, a-b, a*b, a/b); return tup}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let difference = a-b; let multiply = a*b; let divide = a / b; (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum : i32 = a + b; let difference : i32 = a - b; let multiply : i32 = a * b; let divide : i32 = a / b; return (sum, difference, multiply, divide)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum: i32 = a + b; let diff: i32 = a - b; let multiplication: i32 = a * b; let division = a / b; return (sum, diff, multiplication, division)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum = a + b; let dif = a - b; let mult = a * b; let div = a / b; (sum, dif, mult, div)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let sum : i32 = a + b; let dif : i32 = a - b; let mult : i32 = a * b; let div : i32 = a / b; return (sum, dif, mult, div);}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let v1: i32 = a + b; let v2: i32 = a - b; let v3:i32 = a * b; let v4:i32 = a/b; let tup:(i32,i32,i32,i32) = (v1,v2,v3,v4); tup}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b,a-b,a*b,a/b)}
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) (a+b, a-b, a*b, a/b)}