/*File force.c Calculate the piecewise time force. The formula depends on wether time t is less or equal to 3 seconds */ #include #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; }