-
Make variables called:
decimal_number
and set its value to the input number given by the end user.bit_value
and set its value to 32.
-
Now divide the
bit_value
by 2 and check ifdecimal_number
is greater than or equal tobit_value
. If it is, print 'high' for a high note and subtractbit_value
fromdecimal_number
. If not, print 'low' for a low note Repeat whilebit_value
is greater than 1. -
Test your program with some values on the boundaries (for example test it with numbers 0 and 31).