HARMAN interview question

Write a program to calculate factorial