From 4b20b19146ae3cfceb8d9092d683ef08a79baf39 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Wed, 20 Nov 2024 09:00:06 +0000 Subject: [PATCH] solutions: 5 --- smallest_multiple.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 smallest_multiple.rs diff --git a/smallest_multiple.rs b/smallest_multiple.rs new file mode 100644 index 0000000..50eebc7 --- /dev/null +++ b/smallest_multiple.rs @@ -0,0 +1,15 @@ +fn main() { + let mut numerator: f64 = 1.; + + 'outer: loop { + for i in 1..=20 { + if numerator % (i as f64) != 0. { + numerator += 1.; + continue 'outer; + } + } + break; + } + + println!("{}", numerator); +}