subject

In the programming example, converting a number from decimal to binary, given in this chapter (15), you learned how to convert a decimal number into the equivalent binary number. two more number systems, octal (base 8) and hexadecimal (base 16), are of interest to computer scientists. in fact, in c++, you can instruct the computer to store a number in octal or hexadecimal. (appendix c describes these number systems.)

the digits in the octal number system are 0, 1, 2, 3, 4, 5, 6, and 7. the digits in the hexadecimal number system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f. so a in hexadecimal is 10 in decimal, b in hexadecimal is 11 in decimal, and so on.

the algorithm to convert a positive decimal number into an equivalent number in octal (or hexadecimal) is the same as discussed for binary numbers. here, we divide the decimal number by 8 (for octal) and by 16 (for hexadecimal). suppose ab represents the number a to the base b. for example, 7510 means 75 to the base 10 (that is decimal), and 8316means 83 to the base 16 ( that is hexadecimal). then 75310 = 13618 and 75310 = 2f116.

write a program that uses a recursive function to convert a number in decimal to base 8 or base 16.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:30
To become an audio technician, the most successful tactics might include the following. (select all that apply). learning how to persuade other people gaining different types of experience in audio technology learning as much as possible about art history establishing a reputation as a reliable professional
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
How do you share someone else’s tweet with your own twitter followers?
Answers: 1
question
Computers and Technology, 24.06.2019 22:10
In command prompt, whats a command that will list only .ini files in c: \windows\system32 directory?
Answers: 1
You know the right answer?
In the programming example, converting a number from decimal to binary, given in this chapter (15),...
Questions
question
Mathematics, 30.11.2020 20:50
question
Mathematics, 30.11.2020 20:50
Questions on the website: 13722367