answersLogoWhite

0


Best Answer

I am assuming you mean positive integer in decimal notation.

Here is an algorithm that lists the binary representation backwards, that is

from right to left, least significant digit first.

N is the number decimal number

While N > 0

print N rem 2 // output the remainder

N = N/2 // replace N by n divided by 2

end loop

Example: trace for n = 101

n output

101

50 1

25 0

12 1

6 0

3 0

1 1 -- Last one had 0; 3%2 is 1

0 1

Output would be 1010011 ---- from left to right would be 1100101

Check: 64 + 32 + 0 + 0 + 4 + 1 = 101.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Algorithm for finding binary representation of positive decimal integer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Design an algorithm for finding all the factors of positive integerfor example in the case of the integer 12your algorithm should report 12346 and 12?

design an algorithm for finding all the factors of a positive integer


Design an algorithm for finding integer solutions for equations of the form x2 y2 n where n is some given positive integer Determine the time complexity of your algorithm?

yea me too dude. Mahleko :(


What is algorithm evaluation?

evaluation iz same as the testing of an algorithm. it mainly refers to the finding of errors by processing an algorithm..


Numerical method for solving can eqution bisection method?

A root-finding algorithm is a numerical method, or algorithm, for finding a value. Finding a root of f(x) − g(x) = 0 is the same as solving the equation f(x) = g(x).


What is the definition of algorithm?

The definition of the word algorithm is a set of rules for solving a problem in a finite number of steps, as for finding the greatest common divisor.


Who is the inventor of Reverse Delete Algorithm for MST When was this first published?

The Reverse Delete Algorithm for finding the Minimum Spanning Tree was first introduced by Edsger Dijkstra in 1959. He presented this algorithm in his paper titled "A note on two problems in connexion with graphs" which was published in Numerische Mathematik.


What do you mean by finding a pattern in problem solving strategy?

By finding a pattern the first time you solve a problem, then applying this pattern (algorithm) to solve similar problems.


Can blood pressure medicine cause a false positive finding?

Please clarify your question - a false positive finding for what condition?


What is sub-algorithm?

It is an algorithm used by another algorithm as part of the second algorithm's operation.As an example, an algorithm for finding the median value in a list of numbers might include sorting the numbers as a sub-algorithm: There are plenty of algorithms for sorting, and the specifics of the sorting does not matter to the "median value" algorithm, only that the numbers are sorted when the sub-algorithm is done.For what an algorithm is, see related link.


What are the benefits of a genetic algorithm to scientist?

A genetic algorithm acts a search heuristic that mimics the process of natural evolution. Genetic algorithms assist scientists in finding solutions in the fields of computer engineering, chemistry, math, and physics.


What is the algorithm for finding the area of a circle?

Find the radiusMultiply pi by the square of the radius.


What is the solution for finding fourandonefourth?

It is: 4 and 1/4 or 4.25 as a decimal