Min of Three
Write a generic function min_of_three that takes three values of the same type and returns the smallest. Use it with integers.
Expected output:
text
Smallest: 5
Hints:
fn min_of_three<T: PartialOrd>(a: T, b: T, c: T) -> T- Compare pairs: if
ais smallest returna, else comparebandc - You can nest if/else:
if a <= b && a <= c { a } else if b <= c { b } else { c }
rust
fn main() {
}