Capgemini Interview Question

write a program using paper and pen ?????