C program to find the sum of the Geometric Progression (G.P.) series
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)
Geometric Progression (GP):
A series of numbers is called a geometric progression (GP) series if the ratio of any two consecutive terms is always the same.
Example: 2 4 6 8 10 ...
If 'A' is the first term and 'R' is the common ratio, then:
In the below program, we will read the first term, the total number of terms, and a common ratio from user and print the last term and the sum of the G.P. series on the console screen.
Program:
The source code to find the sum of the Geometric Progression (G.P.) series is given below. The given program is compiled and executed using GCC compile on UBUNTU 18.04 OS successfully.
Output:
Explanation:
Here, we read the first term, common ratio, and the total number of terms from the user. Then we found the last term and total of the G.P series and printed them on the console screen.
need an explanation for this answer? contact us directly to get an explanation for this answer