recursion - How to write procedure that recursively outputs the number of odd digits in a natural number? (racket) -
if input number, how can write procedure checks every digit , produces output equal number of odd digits in number?
i'm thinking turning number list first, i'm trying think of easier solution.
also, we're not allowed use "odd?". instead of using "odd?" check whether or not digit odd, can use "quotient"
rather convert string in marekful's comment, try recursively taking off significant digit @ time using mod operation. then, can use quotient function test odd or even.
Comments
Post a Comment