1 2 3 4 5 6 7
//chapter 17 Example 7 clc; clear; close; s1=200;s2=400;s3=600;s4=800; avgspeed=4/(1/s1+1/s2+1/s3+1/s4); printf("The average speed is %3.0f km/hr",avgspeed);