clc clear //Initialization of variables M1=0.2 M2=0.4 D=0.5 //ft f=0.015 //calculations f1=14.5 f2=2.31 dl=(f1-f2)*D/f //results printf("Length of pipe = %.1f ft",dl)