subject

This must be written in Coral. Write 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 / 2

Note: The above algorithm outputs the 0's and 1's in reverse order.

Ex: If the input is 6, the output is:

011

(6 in binary is 110; the algorithm outputs the bits in reverse).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
question
Computers and Technology, 24.06.2019 20:30
How is energy expended in active transport
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
According to your study unit, what is the main reason that improved human relations skills may improve your grades?
Answers: 1
You know the right answer?
This must be written in Coral. Write a program that takes in a positive integer as input, and outpu...
Questions
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
History, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Social Studies, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
question
Mathematics, 16.09.2020 09:01
Questions on the website: 13722362