1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
denis-greek [22]
2 years ago
11

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 binar

y. 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.
Ex: If the input is 6, the output is:
011
(6 in binary is 110; the algorithm outputs the bits in reverse).
Computers and Technology
1 answer:
MAXImum [283]2 years ago
3 0

Answer:

thats what i was about to ask. im not sure

Explanation:

sorry   '-'

You might be interested in
Give a tight bound on the number of times the z = z + 1 statement is executed. i = 2 while ( i > 1 ) { i = floor(i/2) z = z +
Alinara [238K]

Answer:

zero ( 0) times.

Explanation:

In the code;

i = 2

while ( i > 2){

     i = floor( i/2 );

     z = z + 1;

}

the variable " i " is assigned the integer " 2 ", then the while statement loops with a condition of a greater " i " value and divides the value by two for every loop.

But in this case, the while statement is not executed as the value of " i " which is 2 is not greater than but equal to two.

4 0
2 years ago
Can I make all front end project with Javascript OOP(Object Oriented Programming)?
anyanavicka [17]

Answer:

yeah u can my brother go for it

6 0
2 years ago
1 punto
masya89 [10]

Answer:

Retailing.

Explanation:

La venta al por menor o retailing es el suministro de bienes físicos a los consumidores para uso personal, sea en pequeña o grandes cantidades, siempre que esté destinado a consumidores finales. Es un sector que consta de diferentes ramas (como la industria alimentaria, la industria de la moda, la industria del mobiliario para el hogar, etc.). El comercio minorista es el último eslabón de la cadena de suministro que va desde el fabricante hasta el consumidor.

4 0
3 years ago
When developing an estimate, which of the following items is typically marked up with the highest percentage rate?
dmitriy555 [2]

Answer: D. Labor

Explanation:

8 0
1 year ago
Brad, a project manager, wants to build a database to integrate information about employees and tasks that they handle. Brad wan
zhuklara [117]

Answer:

entities

Explanation:

3 0
3 years ago
Other questions:
  • What does CPL stand for
    9·2 answers
  • Ideally, how often should you back up the data on your computer? once an hour, once a day, once a month, once a year. Please hur
    5·2 answers
  • How can website illustrate cooperations and kidness?
    8·1 answer
  • The code int *p; declares p to be a(n) ____ variable. new
    8·1 answer
  • To enter a typed number into a cell, you press Tab or Backspace?​
    7·2 answers
  • This morning when Paul turned on his computer at work, it would not boot. Instead, Paul reported that he heard a loud clicking n
    6·1 answer
  • What is a location where the embedded multimedia terminal is connected to both outside and inside wiring​
    7·1 answer
  • What is wrong with the following code?
    11·1 answer
  • Another way to create a new presentation is from the Home tab
    6·2 answers
  • You can resize a row in a table by dragging the ____.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!