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
Assoli18 [71]
3 years ago
10

5 write a recursive method that returns the number of 1's in the binary representation of n. use the fact that this is equal to

the number of 1's in the representation of n/2, plus 1, if n is odd.
Mathematics
1 answer:
ASHA 777 [7]3 years ago
7 0
Assuming n is a decimal number.
Divide n by 2 repeatedly, and summing the remainders will give the number of one's in binary representation.

pseudocode of algorithm:
Enter value of n:
sum=0;
while n>0 {
    sum=mod(n,2);
    n=n/2   [integer division]
}
Display n, sum


You might be interested in
Solve the equation: f(x) = 3r - 2x +5
Aleks04 [339]
X= 3r+5/2 is the answer I believe
4 0
3 years ago
In this polygon, which angle is an interior angle? Multiple Choice
makvit [3.9K]

Answer:

option c = angle b

Step-by-step explanation:

as angle b is inside the polygon as the rest angles are exterior(outside the polygon )

7 0
3 years ago
Read 2 more answers
A sphere with a radius of 10 centimeters is inscribed in a right cylinder. What is the volume of the right cylinder in terms of
ruslelena [56]
Well, that means that the sides and top are toutching the sphere

radius of sphere=10 so radius of cylinder=10
the height is the diameter or 20

V=hpir^2
v=20pi10^2
v=20pi100
v=2000pi

answer is D
5 0
3 years ago
Read 2 more answers
Find a26 of the sequence-2,-8,-14,-20
ddd [48]

The numbers decrease by 6.

-1, -8, -14, -20, -26, -32, -38, -44, -50, -56, -62, -68, -74, -80, -86, -92, -98, -104, -110, -116, -122, -128, -134, -140, -146

4 0
3 years ago
Find the area and perimeter of a rectangle with a length of 3x + 2 and a width of 4x + 3.
bekas [8.4K]

<em>Answer:</em>

170ft^2

The area is 170ft^2.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Please answer this and I’ll make you Brainly real fast
    6·2 answers
  • two runners, one averaging 9 miles per hour and the other averaging 6 miles per hour, start at the same place and run along the
    14·1 answer
  • Two is equal to 4 less than 3 times a certain number. Find the number.
    10·2 answers
  • The steps to figuring this problem out 9x+3=8x^2+6x
    5·1 answer
  • If f(x) = 2 + x and g(x) = 3 - x, what is go f(-1)?
    5·1 answer
  • Help me with this question please
    5·1 answer
  • The area of the cube is shown on the coordinate plane. What is the surface area of the cube?
    12·2 answers
  • Sophia wants to enlarge a 5-inch by 7-inch rectangular photo by multiplying the dimensions by 3. Find the area of the enlarged p
    14·1 answer
  • 2⁄7 · n = 4 what is the answer
    11·2 answers
  • Help picture below problem 12
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!