Question: JAVA Write a program that asks the user for a positive integer n, and then convert the value of n to binary notation. - Allow

JAVA

Write a program that asks the user for a positive integer n, and then convert the value of n to binary notation.

- Allow the user to perform repeated conversions in a single execution.

- For conversions use repeated division by 2 on the n until it reaches 0.

e.g

n=10

10/2 = 5 remainder is 0, multiply by 1

5/2 = 2 remainder is 1, multiply by 10

2/2 = 1 remainder is 0, multiply by 100

1/2 = 0 remainder is 1, multiply by 1000

Thank you!

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!