text: Count Distinct Rectangles in N * N Chessboard | C # program to count unique rectangles in a chessboard ; Function to count distinct rectangles ; Driver Code
code: using System ; class Rectangle { static int count ( int N ) { int a = 0 ; a = ( N * ( N + 1 ) ) / 2 ; return a ; } public static void Main ( ) { int n = 4 ; Console . Write ( count ( n ) ) ; } }