Number of rectangles in N * M grid | C ++ program to count number of rectangles in a n x m grid ; driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int rectCount ( int n , int m ) { return ( m * n * ( n + 1 ) * ( m + 1 ) ) / 4 ; } int main ( ) { int n = 5 , m = 4 ; cout << rectCount ( n , m ) ; return 0 ; }