0

Write a program to the sum of AP

series:- 1+2+3+4+5+6+7+8+9+10

31st Oct 2017, 6:23 AM
Ishant Dwivedi
Ishant Dwivedi - avatar
5 Réponses
+ 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.
1st Nov 2017, 6:30 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 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);
1st Nov 2017, 2:39 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar