Answered You can hire a professional tutor to get the answer.

QUESTION

A program that adds the numbers 1/2 to itself and 1/3 to itself a large number of times.

A program that adds the numbers 1/2 to itself and 1/3 to itself a large number of times. It is to then compare the values of adding the numbers to multiplying 1/2 and 1/3 times the number of times they were added. The program must first add 1/2 and 1/3, and compare to the value obtain using multiplication instead of addition. It is to do this for the following values: 1,000 10,000 100,000 1,000,000 10,000,000 100,000,000 1,000,000,000 The program should do this using two nested loops. The outer loop determines the number of times to add and starts at a 1000 and increments by multiples of 10 up to a 1,000,000,000. The inner loop does the addition of the numbers 1/2 and 1/3. When the inner loop completes, output the two sums (the ½ and the 1/3) and the two products, and the differences and continue the outer loop. Remember to clear your variables for the sums (accumulators) before the start of the inner loop.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question