Created
June 28, 2022 11:35
-
-
Save aerphanas/d743d52f8d05347a78fe0b585868d6c5 to your computer and use it in GitHub Desktop.
Print Num 1 to 10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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