C program to calculate the sum of the series 1-2+3-4+5-6+7-8...N terms
belongs to collection: Sum of series programs/examples in C programming language
All Answers
total answers (1)
belongs to collection: Sum of series programs/examples in C programming language
total answers (1)
Let's analyse this problem,
Now we can conclude that if we want sum up to an Odd term then we always get sum as ((N+1)/2) and if we want sum up to an Even term the sum is in the form of (-1*(N/2)).
Now Let's make logic for this using c programming,
Output
need an explanation for this answer? contact us directly to get an explanation for this answer