Computer Science, asked by abhishekkumar242006, 2 months ago

Write a menu driven program to calculate and print the sum of each series:
a. Sum(s) = 2-4+6-8+
30 terms​

Answers

Answered by deveshkmk23
0

Answer:

public class Sum

{

public static void main( );

{

int i, n, s=0;

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

{

if (i%4=0)

}

s=s+i;

else

s=s-i;

System.out.Println(“The sum is"+s);

}

}

Similar questions