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.11

Answer

#include #include int main(void) { $\ \ \ \ $double c,m,v1,v2, step, t; $\ \ \ \ $const double g=9.81; $\ \ \ \ $printf("c="); scanf("%lf",&c); $\ \ \ \ $printf("m="); scanf("%lf",&m); $\ \ \ \ $printf("step size="); scanf("%lf",&step); $\ \ \ \ $v1=0; $\ \ \ \ $printf("t(s)$\ \ \ \ $$\ \ \ \ $ v(m/s)%c",0x0A); $\ \ \ \ $for(t=step;t<30;t+=step) $\ \ \ \ ${ $\ \ \ \ $$\ \ \ \ $v2=v1+(g-c/m*v1)*step; $\ \ \ \ $$\ \ \ \ $printf("%g$\ \ \ \ $$\ \ \ \ $ %g%c",t,v2,0x0A); $\ \ \ \ $$\ \ \ \ $v1=v2; $\ \ \ \ $} $\ \ \ \ $return 0; } 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.