text: Find the number of cells in the table contains X | C # program to find number of cells in the table contains X ; Function to find number of cells in the table contains X ; Driver code ; Function call
code: using System ; class GFG { public static int Cells ( int n , int x ) { if ( n <= 0 x <= 0 x > n * n ) return 0 ; int i = 0 , count = 0 ; while ( ++ i * i < x ) if ( x % i == 0 && x <= n * i ) count += 2 ; return i * i == x ? count + 1 : count ; } static public void Main ( ) { int n = 6 , x = 12 ; Console . WriteLine ( Cells ( n , x ) ) ; } }