LTM Limited interview question

write and execute code for factorial