Capgemini interview question

give me compound interest code