Accenture Interview Question

WAP for factorial