
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
C Programming for sum of the series 0.6, 0.06, 0.006, 0.0006, …to n terms
The given series 0.6,0 .o6,.... is a geometric progression where each element is the previous element divided by 10. So find the sum of the series we have to apply the sum of GP one formula for r less than 1(r=0.1 in our case).
Sum = 6/10 [1- (1/10)n/(1-1/10)] Sum = 6/9 [1- (1/10)n] Sum = 2/3[1- (1/10n)]
Example
#include <stdio.h> #include <math.h> int main() { int n = 6; float sum = 2*((1 - 1 / pow(10, n)))/3; printf("sum = %f", sum); }
Output
sum = 0.666666
- Related Articles
- Sum of the first N terms of the series 2,10, 30, 68,…. in C programming
- Sum of the first N terms of the series 5,12, 23, 38…. in C Programming
- Sum of the first N terms of the series 2, 6, 12, 20, 30…. in c programming
- Sum of the series 0.7, 0.77, 0.777 … upto n terms in C++
- Find sum of the series ?3 + ?12 +.... upto N terms in C++
- C++ Program to find the sum of the series 23+ 45+ 75+….. upto N terms
- Find sum of the series 1+22+333+4444+... upto n terms in C++
- Find the sum of the following APs:$0.6, 1.7, 2.8, ……$ to $100$ terms.
- Sum of the series 1.2.3 + 2.3.+ … + n(n+1)(n+2) in C
- Find Sum of Series 1^2 - 2^2 + 3^2 - 4^2 ... upto n terms in C++
- Sum of series 2/3 – 4/5 + 6/7 – 8/9 + …… upto n terms
- C++ Program for sum of arithmetic series
- C/C++ Program to Find the sum of Series with the n-th term as n^2 – (n-1)^2
- Minimum number of power terms with sum equal to n using C++.
- C Program for sum of cos(x) series

Advertisements