Cornerstone OnDemand Interview Question

Write a factorial program in java.