Computer Science, asked by shrishti111213, 1 month ago

Write a Java script to find sum of the series :
s = 1 + x + x2 + x3 + …. + xn​

Answers

Answered by ajb7899
0

Answer:

double sum 0;

for(int i = 0,i<= n ;i++)

{

double term = Math.pow(x,i);

sum = sum + term;

}

System.out.println(sum);

Explanation:

you need to input the value of x earlier.

If it helps mark it as the brainliest giving it 5 stars.

Similar questions