Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #define N 100
- #define v0 1
- #define dt 1e-3
- #define x0 0
- #define t0 0
- int main(void)
- {
- double x = x0, t = t0;
- int i;
- for (i = 0; i < N; ++i)
- {
- x += v0*dt;
- t += dt;
- printf("%d %f %f\n", i, t, x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement