Cognizant interview question

Write a code on recurrsion