C program to find the sum of the Harmonic Progression (H.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)
Harmonic Progression (HP):
A series of numbers is called a harmonic progression (HP) if the reciprocal of the terms are in AP. In simple terms, a, b, c, d, e, f are in HP if 1/a, 1/b, 1/c, 1/d, 1/e, 1/f are in AP.
For two terms 'a' and 'b':
Harmonic Mean = (2 a b) / (a + b)
For two numbers, if A, G, and H are respectively the arithmetic, geometric and harmonic means, then
A ≥ G ≥ H
A H = G2, i.e., A, G, H are in GP
In the below program, we will read the total number of terms from the user and print the H.P. Series and its sum on the console screen.
Program:
The source code to find the sum of the Harmonic Progression (H.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 total number of terms from the user. Then we generated the H.P. series and find its total and printed them on the console screen.
need an explanation for this answer? contact us directly to get an explanation for this answer