Program to print triangular number series till n | Java program to print triangular number series till n ; Function to find triangular number ; Driver function
import java . util . * ; class GFG { static void triangular_series ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) System . out . printf ( " % d ▁ " ; , i * ( i + 1 ) / 2 ) ; } public static void main ( String [ ] args ) { int n = 5 ; triangular_series ( n ) ; } }