solution of fourth question