A DP based C # program to print first n Tribonacci numbers .
using System ; class GFG { static void printTrib ( int n ) { int [ ] dp = new int [ n ] ; dp [ 0 ] = dp [ 1 ] = 0 ; dp [ 2 ] = 1 ; for ( int i = 3 ; i < n ; i ++ ) dp [ i ] = dp [ i - 1 ] + dp [ i - 2 ] + dp [ i - 3 ] ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( dp [ i ] + " ▁ " ) ; }