text: Find the number of cells in the table contains X | Function to find number of cells in the table contains X ; Driver code ; Function call
code: function Cells ( n , x ) { let ans = 0 ; for ( let i = 1 ; i <= n ; i ++ ) if ( x % i == 0 && parseInt ( x / i ) <= n ) ans ++ ; return ans ; } let n = 6 , x = 12 ; document . write ( Cells ( n , x ) ) ;