Computer Science, asked by mercy2, 1 year ago

write a program to print the following series:

Attachments:

Answers

Answered by shashibhaii
1
#codeSnippet using Java.
void main(int n,int a)
{ double sum=0.0;
for(int i=0;i<=n;i++)
{
sum=sum+1/Math.pow(a,i);
}
System.out.println("Sum="+sum);
}
Similar questions