public/subjects/min_and_max
miguel 1aa3484757 fix(rust-piscine) adding a new file for code editor to use 2023-11-14 18:09:37 +00:00
..
README.md docs(min_and_max): make example and output given coherent 2022-11-14 17:24:12 +00:00
main.rs fix(rust-piscine) adding a new file for code editor to use 2023-11-14 18:09:37 +00:00

README.md

min_and_max

Instructions

Create a function named min_and_max that receives three i32 and returns a tuple with the minimum and the maximum number received as input.

pub fn min_and_max(nb_1: i32, nb_2: i32, nb_3: i32) -> (i32, i32) {
}

Usage

Here is a program to test your function

use min_and_max::min_and_max;

fn main() {
    println!(
        "Minimum and maximum are: {:?}",
        min_and_max(9, 2, 4)
    );
}

And its output

$ cargo run
Minimum and maximum are: (2, 9)
$

Notions