Find all factorial numbers less than or equal to n | Javascript program to find all factorial numbers smaller than or equal to n . ; Compute next factorial using previous ; Driver code
function printFactorialNums ( n ) { let fact = 1 ; let x = 2 ; while ( fact <= n ) { document . write ( fact + " " ) ; fact = fact * x ; x ++ ; } } let n = 100 ; printFactorialNums ( n ) ;