Write a java programme to find the sum of series:
S=1/2-2/3+3/4-4/5.....-10/11
plzzzz try to answer fast if u know the full answer
it is urgent
class 10 icse board 2020-2021
I want the programme,output,variable box, not only output
Answers
Answered by
2
Program:
It goes like:
public class brainly
{
public static void main(String[] args)
{
double sum = 0;
double j = 1;
for (double i = 1; i < 11; i++)
{
j = j + 1;
sum = sum + Math.pow(-1, i + 1) * (i / j);
}
System.out.print(sum);
}
}
Output:
-0.2634559884559883
Consider the attachments.
Attachments:
Similar questions