Computer Science, asked by kavyansh306a, 8 months ago

Write a program in java to print series: 1, (1+2), (1+2+3)...n terms

Answers

Answered by bhaveshpandya7893
1

We can get desired sum using below code

int n = 10;

int sum=0;

int prev = 1;

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

sum += prev;

prev += prev * i;

prev += prev * i;

System. out. println(sum);

mark as branliest answer

Answered by Anonymous
0

Explanation:

the answer is in the attached file

hope it helps you

Attachments:
Similar questions