write a python program to give the sum of an A.P for a given no of terms, difference and first term
GIVE CORRECT ANSWER
Share
write a python program to give the sum of an A.P for a given no of terms, difference and first term
GIVE CORRECT ANSWER
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Arithmetic Series is a sequence of terms in which the next item obtained by adding a common difference to the previous item. Or A.P. series is a series of numbers in which the difference of any two consecutive numbers is always the same. This difference called a common difference.
Happy New year
Answer: The required python program is :-
n = int(input("Enter number of terms (integer) : "))
a = int(input("Enter the first term (integer) : "))
d = int(input("Enter the common difference (integer) : "))
s = (n*((2*a)+(n-1)*d))/2
print ("The sum A.P. with first term "+str(a)+", common difference "+str(d)+" and number of terms "+str(n)+" is = "+str(s))
Please mark it as Brainliest.