C program to calculate the sum of the series 1+(1+2) +(1+2+3) +(1+2+3+4) +...+(1+2+3+...+n)
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
We know the sum of natural numbers up to n = (n(n-1))/2
If we simplify this we get, n(n+1)(2n+4)/12
If we put the number of terms in the above equation then we'll get the sum of the series up to that particular term.
Now, let's see Program it using the using c program,
Output
need an explanation for this answer? contact us directly to get an explanation for this answer