Program to print triangular number series till n | C # Program to print triangular number series till n ; Function to find triangular number ; For each iteration increase j by 1 and add it into k ; Increasing j by 1 ; Add value of j into k and update k ; Driver Code
using System ; class GFG { static void triangular_series ( int n ) { int i , j = 1 , k = 1 ; for ( i = 1 ; i <= n ; i ++ ) { Console . Write ( k + " ▁ " ) ; j += 1 ; k += j ; } } public static void Main ( ) { int n = 5 ; triangular_series ( n ) ; } }