Computer Science, asked by floorvixen5700fy, 1 year ago

(e) 2 - 4 + 6 - 8 + ............
.......................... - 20
write a program in Java to find the sum of the series ​

Answers

Answered by kiRiTo1902
7

Answer:

class exp{

   void main(){

       int s=0;

       for(int i=2,k=1;i<=20;i+=2){

           s+=(k*i);

           k=-k;

       }

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

   }

}

Answered by indranihazra8
2

Answer:

please mark me as a BRAINLIST my friend..

Attachments:
Similar questions