Find the Sum of the series 1 + 1 / 3 + 1 / 5 + 1 / 7 + ... till N terms | C # program to find the sum of the series 1 + 1 / 3 + 1 / 5 + ... ; Function to find the sum of the given series ; Initialise the sum to 0 ; Generate the ith term and add it to the sum ; Print the final sum ; Driver Code
using System ; class GFG { static void printSumSeries ( int N ) { float sum = 0 ; for ( int i = 1 ; i <= N ; i ++ ) { sum += ( float ) 1.0 / ( 2 * i - 1 ) ; } Console . WriteLine ( sum ) ; } public static void Main ( string [ ] args ) { int N = 6 ; printSumSeries ( N ) ; } }