(e) 2 - 4 + 6 - 8 + ............
.......................... - 20
write a program in Java to find the sum of the series
Answers
Answered by
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
2
Answer:
please mark me as a BRAINLIST my friend..
Attachments:
Similar questions
Computer Science,
5 months ago
English,
5 months ago
English,
10 months ago
Physics,
10 months ago
Geography,
1 year ago