Question: Language c++ Write a program which prints 2 factor of a positive integer. For example, since $24=2^3cdot 3$, 2 factor of $24$ is $2^3$. 2

Language c++

Write a program which prints 2 factor of a positive integer.

For example, since $24=2^3\cdot 3$, 2 factor of $24$ is $2^3$.

2 factor of $9$ is $2^0$ since $9$ is odd.

Hint: Divide by 2 while the remainder is 0. Count how many divisions you did.

Sample output1:

Type a positive integer: 56 2 factor of 56 is 2^3.

Sample output2:

Type a positive integer: 67 2 factor of 67 is 2^0.

Sample output3:

Type a positive integer: 9 2 factor of 9 is 2^0.

Sample output4:

Type a positive integer: 14 2 factor of 14 is 2^1.

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!