Capgemini interview question

some question on maths (coding)