Exercise-3 of 1st assignment