Contact: aviboots(AT)netvision.net.il
39,955 questions
51,897 answers
573 users
fn next_multiple_of_10(n: i32) -> i32 { if n % 10 == 0 { n + 10 } else { n + (10 - n % 10) } } fn main() { let nums = [23, 10, 0, 1841]; for &n in nums.iter() { println!("{}", next_multiple_of_10(n)); } } /* run: 30 20 10 1850 */