Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

Take two integers, return the quotient and remainder, divmod

//  Take two integers, return the quotient and remainder
fn divmod(dividend: isize, divisor: isize) -> (isize, isize) {
    (dividend / divisor, dividend % divisor)
}

fn main() {
    let (q, r) = divmod(14, 3);
    println!("divmod = quotient {}, remainder {} ", q, r);
}
 
PREVIOUS NEXT
Tagged: #Take #return #quotient #divmod
ADD COMMENT
Topic
Name
5+7 =