Mathematics
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.

answer
Answers: 1

Other questions on the subject: Mathematics

image
Mathematics, 21.06.2019 20:30, kuddlebugsmommy
Martha has a deck of cards. she has lost some of the cards, and now the deck only contains nine spades, eleven diamonds, eight clubs, and twelve hearts. martha predicts that whenever she draws a card from the deck without looking, she will draw a club one-fifth of the time. which activity would best allow martha to test her prediction? a. randomly draw a card from the box and see if it is a club. b. randomly draw a card. then, continue to draw another card until all eight clubs are drawn. c. randomly draw and replace a card 120 times. then, observe how close to 30 times a club is drawn. d. randomly draw and replace a card 100 times. then, observe how close to 20 times a club is drawn.
Answers: 1
image
Mathematics, 21.06.2019 21:00, JamlessJimin
The radius of a sphere is 3 inches. which represents the volume of the sphere?
Answers: 1
image
Mathematics, 21.06.2019 22:00, mairadua14
To decrease an amount by 16% what single multiplier would you use
Answers: 1
image
Mathematics, 22.06.2019 00:30, mercydiaz84
Measure a and b and find their sum. how are the angles related?
Answers: 3
Do you know the correct answer?
Convert to binary - functionsWrite a program that takes in a positive integer as input, and outputs...

Questions in other subjects:

Konu
Mathematics, 17.11.2019 09:31