1. Write a program to display the following terms of the
series –
X^2 + X^5+ X^6+X^9+X^10+X^13+…. N terms
If N=10 then 10 different individual terms has to be printed
Answers
Answered by
1
Answer:
import java.util.*;
class series
{
public static void main(Strong aega[])
{
Scanner op = new Scanner (System.in);
int x,i,sum=0,n;
System.out .println("enter the value of x");
System.out .println("enter the value of n");
n=op.nextInt();
x=op.nextInt();
for(i=2;i<=x;i+3;i+1)
{
sum+=(int)(Math.pow(x,I));
System.out println("the sum of series="+sum);
}
}
}
Explanation:
I hope it will help you
Similar questions