Find the Sum of the series 1 + 2 + 9 + 64 + 625 + 7776 . . . till N terms | C # program for the above approach ; Function to find the sum of series ; Generate the ith term and add it to the sum ; Print the sum ; Driver Code
using System ; class GFG { static void printSeriesSum ( int N ) { double sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { sum += Math . Pow ( i , i - 1 ) ; } Console . Write ( sum + " STRNEWLINE " ) ; } public static void Main ( String [ ] args ) { int N = 5 ; printSeriesSum ( N ) ; } }