Question: C++ language 1. Generate a positive random integer 2. Multiply the number by 3 3. If the product is odd then add 1 to it

C++ language 1. Generate a positive random integer

2. Multiply the number by 3

3. If the product is odd then

add 1 to it

end if

4. Divide the number (product or sum) by 2

5. Multiply the quotient by 3

6. Divide the number by 9

if the original number was even then

multiply the quotient by 2

else

multiply the quotient by 2 and add 1 to the product

end if

display the original number

display the final product or sum

if the original number equals the final product then

display a message of success

else

display a message of failure

end if

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!