Find amount of water wasted after filling the tank | Function to calculate amount of wasted water ; filled amount of water in one minute ; total time taken to fill the tank because of leakage ; wasted amount of water ; driver program
function wastedWater ( V , M , N ) { let wasted_amt , amt_per_min , time_to_fill ; amt_per_min = M - N ; time_to_fill = V / amt_per_min ; wasted_amt = N * time_to_fill ; return wasted_amt ; } let V , M , N ; V = 700 ; M = 10 ; N = 3 ; document . write ( wastedWater ( V , M , N ) , " " ) ; V = 1000 ; M = 100 ; N = 50 ; document . write ( wastedWater ( V , M , N ) ) ;