Find n | C # program to find n - th term of series 1 , 3 , 6 , 10 , 15 , 21. . . ; Function to find the nth term of series ; Loop to add numbers ; Driver code
using System ; class GFG { static int term ( int n ) { int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) ans += i ; return ans ; } public static void Main ( ) { int n = 4 ; Console . WriteLine ( term ( n ) ) ; } }