Skip to content

Instantly share code, notes, and snippets.

@Shaun289
Last active October 21, 2021 21:38
Show Gist options
  • Save Shaun289/e9d73074434f7b08c20e6cbc6c496f39 to your computer and use it in GitHub Desktop.
Save Shaun289/e9d73074434f7b08c20e6cbc6c496f39 to your computer and use it in GitHub Desktop.
rust study : while loop
// The rust programming ko https://rinthel.github.io/rust-lang-book-ko/ch03-05-control-flow.html
// compiled on https://play.rust-lang.org/
/* result
*
**
***
****
*****
******
*******
********
*********
*/
fn main() {
let mut row = 0;
while row < 10 {
let mut column = 0;
while column < row {
print!("*");
column = column + 1;
}
println!("");
row = row + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment