Skip to content

Instantly share code, notes, and snippets.

@aerphanas
Created June 28, 2022 11:35
Show Gist options
  • Select an option

  • Save aerphanas/d743d52f8d05347a78fe0b585868d6c5 to your computer and use it in GitHub Desktop.

Select an option

Save aerphanas/d743d52f8d05347a78fe0b585868d6c5 to your computer and use it in GitHub Desktop.
Print Num 1 to 10
fn main() {
let mut from:i32 = 0;
let to:i32 = 10;
loop {
if from != to {
print!("{},",from);
from = from + 1;
} else if from == to {
println!("{}",to);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment