C++ Exercises: Display the sum of the specified series
23. Sum of the Series [9 + 99 + 999 + ...]
Write a program in C++ to display the sum of the series [ 9 + 99 + 999 + 9999 ...].
Visual Presentation:

Sample Solution:-
C++ Code :
Sample Output:
Display the sum of the series [ 9 + 99 + 999 + 9999 ...] ------------------------------------------------------------- Input number of terms: 5 9 99 999 9999 99999 The sum of the sarise = 111105
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C++ program to generate the series 9, 99, 999, ... for n terms and compute their sum.
- Write a C++ program that constructs numbers of repeated 9's and adds them together, printing each term.
- Write a C++ program to display a series where each term is formed by appending a 9 to the previous term, then output the total sum.
- Write a C++ program that reads n and prints the series of numbers consisting of n repetitions of 9, followed by the sum of these numbers.
C++ Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a program in C++ to display the n terms of harmonic series and their sum.
Next: Write a program in C++ to display the sum of the series [ 1+x+x^2/2!+x^3/3!+....].
What is the difficulty level of this exercise?