subject

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. You will need to write a second function to reverse the string. Ex: If the input is: 6
the output is: 110

Your program must define and call the following two functions.

The IntegerToReverseBinary function should assign binaryValue with a string of 1's and 0's representing the integerValue in binary (in reverse order).
The ReverseString function should assign reversedString with the reverse of inputString.

void IntegerToReverseBinary(int integerValue, char binaryValue[])
void ReverseString(char inputString[], char reversedString[])

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:00
Given the resulting p-values, would you reject or fail to reject the null hypotheses (assuming a 0.05 significance level)? what does your decision mean in the context of this problem? would you proceed with changing the design of the arrow, or would you keep the original design?
Answers: 2
question
Computers and Technology, 22.06.2019 21:50
Answer the following questions regarding your system by using the commands listed in this chapter. for each question, write the command you used to obtain the answer. a. what are the total number of inodes in the root filesystem? how many are currently utilized? how many are available for use? b. what filesystems are currently mounted on your system? c. what filesystems are available to be mounted on your system? d. what filesystems will be automatically mounted at boot time?
Answers: 1
question
Computers and Technology, 24.06.2019 20:00
Individuals suffering from technology overload feel distressed when deprived of computers and mobile devices.true/fasle
Answers: 2
question
Computers and Technology, 24.06.2019 22:00
Need getting google account back, big issue
Answers: 2
You know the right answer?
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's repre...
Questions
question
Chemistry, 05.12.2019 08:31
question
Mathematics, 05.12.2019 08:31
question
Health, 05.12.2019 08:31
question
Mathematics, 05.12.2019 08:31
Questions on the website: 13722363