summaryrefslogtreecommitdiff
path: root/accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel.c')
-rw-r--r--accel.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/accel.c b/accel.c
new file mode 100644
index 0000000..6b61c69
--- /dev/null
+++ b/accel.c
@@ -0,0 +1,14 @@
+/* Find the acceleration */
+
+#include <stdio.h>
+
+int main()
+{
+ static float FORCE_OF_GRAVITY = 9.81;
+ int pullforce = 20;
+ float coeffOfFriction = 0.2;
+ float weight = 5.0;
+ /*calculate and display acceleration */
+ printf("Acceleration a = %f(m/s^2)\n",(pullforce-coeffOfFriction*weight*FORCE_OF_GRAVITY)/weight);
+ return 0;
+}