Skip to content

Instantly share code, notes, and snippets.

@arunlakshman
Created September 17, 2017 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunlakshman/5934536608bbc54437c58802938c7301 to your computer and use it in GitHub Desktop.
Save arunlakshman/5934536608bbc54437c58802938c7301 to your computer and use it in GitHub Desktop.
fn main() {
let range = 1..1000;
let result: i32 = range.filter(|num| num % 3 == 0 || num % 5 ==0).sum();
println!("{}",result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment