Cognizant interview question

write a code for factorial and fibonacci ?