Nagarro Interview Question

Write a program for factorial.