text: Hexanacci Numbers | C # simple recursive program to print Nth Hexanacci numbers . ; Function to print the Nth Hexanacci number ; Driver code
code: using System ; class GFG { static int printhexaRec ( int n ) { if ( n == 0 n == 1 n == 2 n == 3 n == 4 n == 5 ) return 0 ; else if ( n == 6 ) return 1 ; else return ( printhexaRec ( n - 1 ) + printhexaRec ( n - 2 ) + printhexaRec ( n - 3 ) + printhexaRec ( n - 4 ) + printhexaRec ( n - 5 ) + printhexaRec ( n - 6 ) ) ; } static void printhexa ( int n ) { Console . Write ( printhexaRec ( n ) + " STRNEWLINE " ) ; } public static void Main ( ) { int n = 11 ; printhexa ( n ) ; } }