Find all factorial numbers less than or equal to n
A number N is called a factorial number if it is the factorial of a positive integer. For example, the first few factorial numbers are1, 2, 6, 24, 120, ...Given a number n, print all factorial numbers smaller than or equal to n. Examples : Input: n = 100Output: 1 2 6 24Input: n = 1500Output: 1 2 6 2