blob: 70d371b3eefc789656275a7f02f941ee81eb8a93 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/*File force.c
Calculate the piecewise time force. The formula depends on wether time t is less or equal to 3 seconds */
#include <stdio.h>
#define M 3
int main()
{
int x = 0;
while(x<10)
{
double p,t;
printf("Useing time %i", x);
t= x;
if(t<=M)
{
p = 20;
}
else
{
p = 4*(t+2);
}
printf("Force p = %f (N)\n",p);
x++;
}
return 0;
}
|