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....
Copyright © 2024 EHUB.TIPS team's - All rights reserved.
Answers & Comments
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....