nick34992
4/12/2017 - 4:31 PM

Rust: For Loop: Modulo Operator

Rust: For Loop: Modulo Operator

fn main() {
  for x in 0..10 {
    if x % 2 == 0 { 
      continue;   // skip even numbers
    }
    println!("{}", x);  // print odd numbers
  }
}