Question: Write a program to calculate the two following sums using loops: s = k = 1 4 9 9 9 7 1 k 2 +

Write a program to calculate the two following sums using loops:
s=k=1499971k2+5k+6,t=k=4999711k2+5k+6
and calculates r using the simple formula:
r=13-150000
Your program should print out 5 numbers: first print out s, result of the first sum,
with %f; then print t, the result of the second sum, with %f; then print out both
r-t and r-s using one of %f,% e or %g, depending on which you think is most
useful.
Hint: When the computer calculates these, they will probably not be the same.
However, mathematically they should be the same - try partial fractions if you
want to see why.
Write a program to calculate the two following

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 Programming Questions!