Computer Science, asked by Daaniyalkhan12, 9 months ago

Write a program in Java to print the sum of the series:
1 + 2 + 9 + 64 + 625 + 7776…up to 10 terms.

Answers

Answered by IamGenesis
1

Answer:

int s = 0;

for (int i = 1; i<=10; i++){

s = s + Math.pow(i,(i-1));

}

System.out.println("sum is" + s);

write this inside the method it will work

Similar questions