From 97a693d996c79fb2a008b19750d8bb45512e01a2 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 6 Feb 2017 11:26:44 -0500 Subject: Inital commit --- force.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 force.c (limited to 'force.c') diff --git a/force.c b/force.c new file mode 100644 index 0000000..70d371b --- /dev/null +++ b/force.c @@ -0,0 +1,26 @@ +/*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; +} -- cgit v1.2.3-70-g09d2