summaryrefslogtreecommitdiff
path: root/1553/CH17/EX17.6/17Ex6.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH17/EX17.6/17Ex6.sce')
-rw-r--r--1553/CH17/EX17.6/17Ex6.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/1553/CH17/EX17.6/17Ex6.sce b/1553/CH17/EX17.6/17Ex6.sce
new file mode 100644
index 000000000..dac252640
--- /dev/null
+++ b/1553/CH17/EX17.6/17Ex6.sce
@@ -0,0 +1,15 @@
+//chapter 17 Ex6
+
+clc;
+clear;
+close;
+s1=25;s2=4; //given speeds in km/hr
+function [s]=average(s1,s2)
+ s=(2*s1*s2)/(s1+s2);
+endfunction
+
+s=average(25,4);
+t=5+(48/60); //converting minutes into hours
+d=t*s; //distance=time*speed
+dpost=d/2;
+printf("The distance of post office from village is %2.0f km",dpost);