answersLogoWhite

0

Sum of geometric series using c program?

Updated: 8/11/2023
User Avatar

Wiki User

āˆ™ 14y ago

Best Answer

there are different ways of writing dis program... 1+x+(x*x)+(x*x*x*)+....has a formula for its sum... the sum for a geometric series with a as initial value and x as common ratio is (a*(pow(r,n)-1))/(r-1).... where a=1;r=x.. accept the values of x and n through keyboard remember to take x as a float value!! apply the formula and be careful about the parantheses. happy programming!!!

User Avatar

Wiki User

āˆ™ 14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

āˆ™ 15y ago

#include<stdio.h>

#include<math.h>

void main()

{

float pow = 2.0, nr, dr = 1.0, x1, sum;

int i = 1,n,s = -1,x;

clrscr();

printf("\n\n\t ENTER THE ANGLE...: ");

scanf("%d", &x);

x1 = 3.142 * (x / 180.0);

sum = 1.0;

nr = x1*x1;

printf("\n\t ENTER THE NUMBER OF TERMS...: ");

scanf("%d",&n);

while(i<=n)

{

dr = dr * pow * (pow - 1.0);

sum = sum + (nr / (dr * s));

s = s * (-1);

pow = pow + 2.0;

nr = nr * x1 * x1;

i++;

}

printf("\n\t THE SUM OF THE COS SERIES IS..: %0.3f", sum);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

āˆ™ 12y ago

just get away

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Sum of geometric series using c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?


How can you tell if a infinite geometric series has a sum or not?

The geometric series is, itself, a sum of a geometric progression. The sum of an infinite geometric sequence exists if the common ratio has an absolute value which is less than 1, and not if it is 1 or greater.


What is the sum of an infinite geometric series is?

It depends on the series.


What is the sum of the infinite geometric series?

The sum of the series a + ar + ar2 + ... is a/(1 - r) for |r| &lt; 1


What is the formula for the sum of an infinite geometric series?

your face thermlscghe eugbcrubah


A geometric progression has a common ratio -1/2 and the sum of its first 3 terms is 18. Find the sum to infinity?

The sum to infinity of a geometric series is given by the formula Sāˆž=a1/(1-r), where a1 is the first term in the series and r is found by dividing any term by the term immediately before it.


A geometric series has first term 4 and its sum to infinity is 5 Find the common ratio?

1/8


Determine the sum of the infinite geometric series -27 plus 9 plus -3 plus 1?

-20


If the sum of an infinite geometric series is 12 and the common ratio is one third then term 1 is what?

Eight. (8)


Is the sum of two geometric sequence a geometric sequence?

No.


The sum to three terms of geometric series is 9 and its sum to infinity is 8. What could you deduce about the common ratio. Why. Find the first term and common ratio?

The geometric sequence with three terms with a sum of nine and the sum to infinity of 8 is -9,-18, and 36. The first term is -9 and the common ratio is -2.


To find LCM of n numbers using 8085 programs?

sample program in sum of the series using the formula for s=n/2[2a+{n-1}d] in 8085