print the java series
Attachments:
Answers
Answered by
2
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
int pow=2;
int denominator=3;
float sum=0f;
for(int i=3;i<=11;i++)
{ int xpow =(int)Math.pow(x,pow);
float xd=(float)xpow/denominator;
sum=sum+xd;
pow++;
denominator++;
}
sum=sum+5;
System.out.println("Sum of series with x = "+x+" = "+sum);
}
}
Explanation:
it is a java program
Attachments:
Similar questions