Find a range of composite numbers of given length | Method to find factorial of given number ; To print range of length n having all composite integers ; Driver Code
function factorial ( n ) { if ( n == 0 ) return 1 ; return n * factorial ( n - 1 ) ; } function printRange ( n ) { let a = factorial ( n + 2 ) + 2 ; let b = a + n - 1 ; document . write ( ` ${ a } ${ b } ` ) ; return 0 ; } let n = 3 ; printRange ( n ) ;