Puzzle 13Reverse the Polarity of the Neutron Flow
 fn​ ​display_neutron_flow​(polarity: isize) {
 "Neutron Flow is {}"​,
 if​ polarity < 0 { ​"reversed"​} ​else​ { ​"normal"​ }
 fn​ ​main​() {
 let​ polarity = 1;
 let​ polarity = polarity ​-​ 2;

Guess the Output


Try to guess what the output is before moving to the next page.


The program will display the following output:

 Neutron Flow is reversed
 Neutron ...

Get Rust Brain Teasers now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.