text: Maximum number of 2 x2 squares that can be fit inside a right isosceles triangle | C # program to count number of 2 x 2 squares in a right isosceles triangle ; removing the extra part we would always need ; Since each square has base of length of 2 ; Driver code
code: using System ; class GFG { public static int numberOfSquares ( int _base ) { _base = ( _base - 2 ) ; _base = _base / 2 ; return _base * ( _base + 1 ) / 2 ; } public static void Main ( ) { int _base = 8 ; Console . WriteLine ( numberOfSquares ( _base ) ) ; } }