terms of the series 0.7 +0.77 +0.777 + ..... to n terms
Answers
Step-by-step explanation:
Recommended: Please try your approach on {IDE} first, before moving on to the solution.
Approach Used :
Let’s denote the sum of the series by S:
Sum = 0.7 + 0.77 + 0.777 + …. up to n terms
= 7/9(0.9 + 0.99 + 0.999 + … up to n terms)
= 7/9[(1 – 0.1) + (1 – 0.01) + (1-0.001) + … up to n terms]
= 7/9[(1 + 1 + 1… upto n terms) – (1/10 + 1/100 + 1/1000 + … upto n terms)]
= 7/9[n – 0.1 * (1 – (0.1)n)/(1 – 0.1)]
= 7/81[9n – 1 + 10-n]
Below is the Implementation to find the sum of given series:
C++
// C++ program for sum of the series 0.7,
// 0.77, 0.777, ... upto n terms
#include <bits/stdc++.h>
using namespace std;
// function which return the
// the sum of series
float sumOfSeries(int n)
{
return .086 * (9 * n - 1 +
pow(10, (-1) * n));
}
// Driver code
int main()
{
int n = 2;
cout << sumOfSeries(n);
return 0;
}
Java
Python3
C#
PHP
Output :1.46286
i will do it soon
Step-by-step explanation:
d
g
v
g
g
g
o
k
hd
g
t
t
y
g
u
g
u
y
mg
g
thanks