Capgemini Interview Question

some question on maths (coding)