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