February 2022
Intermediate to advanced
140 pages
2h 28m
English
| Puzzle 4 | Byte-Sized Chunks |
| | fn main() { |
| | let mut counter : i8 = 0; |
| | loop { |
| | println!("{}", counter); |
| | counter += 1; |
| | } |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
The answer depends on how you run the program.
If you run the program in debug mode with cargo run, the program will display a series of numbers from 0 to 127 and then crash with the following error message: thread ’main’ panicked at ’attempt to add with overflow’, overflow\src\main.rs:6:9.
If you run the ...
Read now
Unlock full access