in reply to John Guttag's book - 2nd exercise. My attempt in Perl.
Point to note is, it should only use if/else/elsif loops and / or comparison operators.
So no modulo operator, no division operator, no arithmetic operators, no bitwise foo... how would you determine oddness only with comparison? You would need an array which holds all odd values of |N. My computer can't.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: John Guttag's book - 2nd exercise. My attempt in Perl.
by Laurent_R (Canon) on May 20, 2017 at 21:29 UTC | |
by shmem (Chancellor) on May 20, 2017 at 21:37 UTC | |
by Laurent_R (Canon) on May 20, 2017 at 21:56 UTC | |
|
Re^2: John Guttag's book - 2nd exercise. My attempt in Perl.
by pritesh_ugrankar (Monk) on May 21, 2017 at 10:58 UTC |