Question: Question 12 Please i need help with this: Write a program that asks the user to enter a positive integer, and then uses a recursive

Question 12

Please i need help with this: Write a program that asks the user to enter a positive integer, and then uses a recursive function to print out the binary representation for that number.

Design and create the program with C++

Question 13

Update your code from the previous question to handle the case where the user may enter 0 or a negative number.

Heres a sample output (assuming 32-bit integers):

Enter an integer: -15 11111111111111111111111111110001

Hint: You can turn a negative integer into a positive one by converting it to an unsigned integer. These have identical bit representations (the type is used to determine how to interpret the number into decimal).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!