February 2022
Intermediate to advanced
140 pages
2h 28m
English
| Puzzle 16 | Double or Nothing |
| | fn double_it(n: i32) -> i32 { |
| | n * 2 |
| | } |
| | |
| | fn double_it(n: f32) -> f32 { |
| | n * 2.0 |
| | } |
| | |
| | fn main() { |
| | println!("2 * 4 = {}", double_it(2)); |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
The program will fail to compile, and you’ll receive the following error message:
| | error[E0428]: the name "double_it" is defined multiple times |
Read now
Unlock full access