Numerical Methods for Engineers

Published by McGraw-Hill Science/Engineering/Math
ISBN 10: 0073401064
ISBN 13: 978-0-07340-106-5

Chapter 2 - Programming and Software - Problems - Page 48: 2.9

Answer

#include #include int main(void) { $\ \ \ \ $double A,P,i,pow; $\ \ \ \ $int n; $\ \ \ \ $printf("P=");scanf("%lf",&P); $\ \ \ \ $printf("i=");scanf("%lf",&i); $\ \ \ \ $printf("year$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $A%c",0x0A); $\ \ \ \ $printf("____________________________________________________&c",0x0A); $\ \ \ \ $pow=1; $\ \ \ \ $for(n=1;n<=5;n++) $\ \ \ \ ${ $\ \ \ \ $$\ \ \ \ $pow=pow*(i+1); $\ \ \ \ $$\ \ \ \ $A=P*i*pow/(pow-1); $\ \ \ \ $$\ \ \ \ $printf("%d$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$\ \ \ \ $ %g%c",n,A,0x0A); $\ \ \ \ $} $\ \ \ \ $return 0; } --- $Result$ $\begin{array}{ll}{\mathrm{n}} & {\mathrm{A}} \\ \hline 1 & {58630} \\ {2} & {30251.9} \\ {3} & {20804.5} \\ {4} & {16091.2} \\ {5} & {13270.6}\end{array}$ ________________________________________________________ also, see the following image:

Work Step by Step

--
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.