Tetrahedral Numbers | C # Program to find the nth tetrahedral number ; Function to find Tetrahedral Number ; Driver code
using System ; public class GFG { static int tetrahedralNumber ( int n ) { return ( n * ( n + 1 ) * ( n + 2 ) ) / 6 ; } static public void Main ( ) { int n = 5 ; Console . WriteLine ( tetrahedralNumber ( n ) ) ; } }