diff --git a/Loops/Basic/Harmonic Progression.txt b/Loops/Basic/Harmonic Progression.txt index 84768dc..4f4a21c 100644 --- a/Loops/Basic/Harmonic Progression.txt +++ b/Loops/Basic/Harmonic Progression.txt @@ -4,4 +4,25 @@ Output: Nth term #Example: Input: A=2, D=4, N=5 -Output: 0.055 (Approx) \ No newline at end of file +Output: 0.055 (Approx) + +Contribution by Zaid Parkar:- +Time Complexity: O(n Log n). + + +code : + +#include +using namespace std; + +int main() +{ + double a,d,n,s; + + cout<<"Enter a,d and n "<>a>>d>>n; //Input data + + s=1/(a+(n-1)*d); //Formula + + cout <