C#: Calculate the sum of the series [ x - x^3 + x^5 - x^7 + x^9 -.....]
Write a program in C# Sharp to find the sum of the series [ x - x^3 + x^5 - x^7 + x^9 - ........].
Sample Solution:-
C# Sharp Code:
Sample Output:
Calculate the sum of the series [ x - x^3 + x^5 - x^7 + x^9 - .....]: ------------------------------------------------------------ Input the value of x :Input number of terms : The sum = 410 Number of terms = 5 The value of x = 2
Flowchart:
![Flowchart: Calculate the sum of the series [ x - x^3 + x^5 - x^7 + x^9 -.....]](https://www.w3resource.com/w3r_images/csharp-for-loop-exercise-24.png)
C# Sharp Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a program in C# Sharp to display the sum of the series [ 1+x+x^2/2!+x^3/3!+....].
Next: Write a program in C# Sharp to display the n terms of square natural number and their sum.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.