question mentioned below in attached files