Number of rectangles in N * M grid | C # Code to count number of rectangles in N * M grid ; Driver code
using System ; class GFG { public static long rectCount ( int n , int m ) { return ( m * n * ( n + 1 ) * ( m + 1 ) ) / 4 ; } public static void Main ( ) { int n = 5 , m = 4 ; Console . WriteLine ( rectCount ( n , m ) ) ; } }