subject
Mathematics, 29.02.2020 04:53 lamafiablanca1ovtpyl

Convert to binary - functionsWrite a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is:As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string. Ex: If the input is:6the output is 110.

ansver
Answers: 1

Another question on Mathematics

question
Mathematics, 20.06.2019 18:04
Hannah works at the mall selling book bags. she sold 35 book bags in 5 hours. how many book bags did she sell per hour?
Answers: 1
question
Mathematics, 21.06.2019 14:30
Organisms that live in the alpine and taiga biomes have developed unique adaptations that aid in their survival. the douglas-fir is a conifer tree that grows in the taiga biome. it has an average height of about 70 feet, and its wood is an important source of lumber.
Answers: 3
question
Mathematics, 21.06.2019 15:00
Listed in the table is the percentage of students who chose each kind of juice at lunchtime. use the table to determine the measure of the central angle you would draw to represent orange juice in a circle graph
Answers: 3
question
Mathematics, 21.06.2019 18:30
If you have the following equation, 2/3x+5/6-x=2-3/4x what would you multiply each term by to get rid of all the fractions
Answers: 3
You know the right answer?
Convert to binary - functionsWrite a program that takes in a positive integer as input, and outputs...
Questions
question
Computers and Technology, 02.01.2022 03:40
question
Mathematics, 02.01.2022 03:50
question
Mathematics, 02.01.2022 03:50