Solve problem 5 in Fortran.