Computer Science, asked by subrao8888, 1 month ago

Write a program to calculate the sum of the following series:
i. S2-4+6-8+---------20
ii. S
5- 2 2 + 1 2 + 1 2 + 1/ +
.n terms​

Answers

Answered by Ars2685
1

Explanation:

i)

for ( int i =2 ; i <= 20 ;i=i+2)

if (i °/▪︎4==0)

s=s- i

else

s=s+I

Similar questions