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!
VenerisAsgard
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { return (a+b, a-b, a*b, a/b);}
infamous-711
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)}
kriskwiatkowski
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);}
nicolaygerold
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)}
jhq223
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)}
francisco-cmyk
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let add = a + b; let sub = a - b; let times = a * b; let div = a / b; return (add, sub, times, div)}
xbarnett
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)}
arukanoido
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 product = a * b; let quotient = a / b; (sum, difference, product, quotient)}
Masber
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)}
hbdo
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)}
carlos-quantexai
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide) let result = (a+b, a-b, a*b, a/b); result}
mk-comm
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)}
jdbrew2
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // Perform the required mathematical operations let sum = a + b; let difference = a - b; let product = a * b; let quotient = a / b; (sum, difference, product, quotient)}
jdbrew2
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // Perform the required mathematical operations let sum = a + b; let difference = a - b; let product = a * b; let quotient = a / b; (sum, difference, product, quotient)}
jdbrew2
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { // Perform the required mathematical operations let sum = a + b; let difference = a - b; let product = a * b; let quotient = a / b; // Return a tuple of the results (sum, difference, product, quotient)}
oTTeuMsTudio
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)}
majesticalcreature
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)}
dslex35
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)}
ad0x99
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 multiply = a * b; let divide = a / b; (sum, diff, multiply, divide)}
josschne
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)}
sander-b-postnl
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)}
nordicmachine
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)}
Mitrodan
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)}
rot11
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)}
hendrikdevloed
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)}
amassare
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)}
matei
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)}
zavakid
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)}
Johnchoi913
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)}
Parallaxes
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)}
brum-b0
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)}
MosesMp3
pub fn math_operations(a: i32, b: i32) -> (i32, i32, i32, i32) { return (a+b,a-b,a*b,a/b); // TODO: Return a tuple of 4 values: (sum, difference, multiply, divide)}
i5-650
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 )}
retinotopic
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);}
hhornbacher
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)}
ogaca42
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)}
Ustin
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)}
pbjarterot
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)}
CianciuStyles
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)}
ayushrawat10
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)}
AsymetricData
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 as i32)}
otherJL0
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)}
l3vith
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 as i32)}
Siddev09
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)}
atonminion
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 as i32, a-b as i32, a*b as i32, a/b as i32);}
atonminion
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 as i32, a-b as i32, a*b as i32, a/b as i32);}
atonminion
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 as i32, a-b as i32, a*b as i32, a/b as i32);}
damascussteel21
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)}
daanbouwman19
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)}
fuuman
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)}