write a program to print the following series:
Attachments:
Answers
Answered by
0
In winter we want more energy so we feel more hungry
mercy2:
what the heck !!!!
Answered by
1
Answer:
import java.util.*;
class cal
{
public static void main ()
{
Scanner sc= new Scanner(System.in);
double a,s=0.0d,i,n;
System.out.println ("enter a number");
a=sc.nextDouble();
System.out.println ("enter a term for your series");
n=sc.nextDouble();
for (i=1.0;i <=n;i++)
s=s+(1.0/Math.pow (a,i));
System.out.println ("required sum="+s);
}}
Explanation:
I hope it helps you and don't forget to mark me the brainliest....
Similar questions