0
Write a program to the sum of AP
series:- 1+2+3+4+5+6+7+8+9+10
2 Answers
+ 5
@Gordie
Sorry, I assumed that if he knew what an AP was, he must be familiar with the usual symbols, a, n and d.
+ 3
Or for a general AP:
S = (n/2)*((2*a)+((n-1)*d));
Where the symbols stand for the usual meanings:
a = First Term, d = Difference of adjacent terms, n = Number of Terms.
And if you don't have the 'd', but instead the last term 'l' :
S = (n/2)*(a+l);