Panasonic Interview Question

write a function about factorial