ex3.24 solution